Codeigniter: how to sanitize a string? - codeigniter-3

I have imported a string from excel sheet. Before inserting it to database, i want to sanitize it. Is there a builtin codeigniter function to sanitize such data?
I believe $this->input->get() and $this->input->post() is only for GET and POST data.

Related

SQL Cast string as hyperlink

My source data come from Pervasive SQL and returned in Excel (as external data query). I test the code in PCC.
My tables contains a file path and file name and when concatenated together I get a sting value. I want to cast this string as a hyperlink value so that I don't have to convert it in Excel.
Select path + file as link from file_source
There is no hyperlink data type in SQL Server. You need to use a VARCHAR i.e. VARCHAR(100) to store the link and then get the application or excel to display it as a hyperlink.
See:
How to change field type to hyperlink in SQL

Which format Alinea sol report module use to store report fields in sugarcrm?

we use alinea sol plugin to generate report in our sugarcrm. In database, asol_reports table in report_fields column, alinea sol store report fields definition in base64 encoded text. So, I decoded that, i get this result
"a:2:{s:6:"tables";a:1:{i:0;a:2:{s:4:"data";a:3:{i:0;a:17:{s:5:"field";s:10:"account_id";s:5:"alias";s:12:"Account Name";s:14:"fieldReference";s:10:"account_id";s:7:"visible";s:3:"yes";s:13:"sortDirection";s:1:"0";s:9:"sortOrder";s:0:"";s:8:"function";s:1:"0";s:3:"sql";s:0:"";s:6:"format";a:1:{s:4:"type";s:0:"";}s:8:"grouping";s:7:"Grouped";s:13:"groupingOrder";s:0:"";s:4:"type";s:6:"relate";s:3:"key";s:0:"";s:9:"isRelated";b:0;s:5:"index";s:3:"0_1";s:12:"enumOperator";s:0:"";s:13:"enumReference";s:0:"";}i:1;a:17:{s:5:"field";s:11:"case_number";s:5:"alias";s:6:"Number";s:14:"fieldReference";s:11:"case_number";s:7:"visible";s:3:"yes";s:13:"sortDirection";s:1:"0";s:9:"sortOrder";s:0:"";s:8:"function";s:1:"0";s:3:"sql";s:0:"";s:6:"format";a:1:{s:4:"type";s:0:"";}s:8:"grouping";s:1:"0";s:13:"groupingOrder";s:0:"";s:4:"type";s:3:"int";s:3:"key";s:0:"";s:9:"isRelated";b:0;s:5:"index";s:3:"1_1";s:12:"enumOperator";s:0:"";s:13:"enumReference";s:0:"";}i:2;a:17:{s:5:"field";s:11:"description";s:5:"alias";s:11:"Description";s:14:"fieldReference";s:11:"description";s:7:"visible";s:3:"yes";s:13:"sortDirection";s:1:"0";s:9:"sortOrder";s:0:"";s:8:"function";s:1:"0";s:3:"sql";s:0:"";s:6:"format";a:1:{s:4:"type";s:0:"";}s:8:"grouping";s:1:"0";s:13:"groupingOrder";s:0:"";s:4:"type";s:4:"text";s:3:"key";s:0:"";s:9:"isRelated";b:0;s:5:"index";s:3:"2_1";s:12:"enumOperator";s:0:"";s:13:"enumReference";s:0:"";}}s:6:"config";a:10:{s:7:"visible";b:1;s:10:"multiQuery";b:0;s:12:"deletedUsage";b:0;s:15:"paginationUsage";b:0;s:17:"paginationEntries";s:0:"";s:6:"titles";a:1:{s:7:"visible";b:1;}s:7:"headers";a:1:{s:7:"visible";b:1;}s:9:"subtotals";a:1:{s:7:"visible";b:1;}s:6:"totals";a:1:{s:7:"visible";b:1;}s:10:"pagination";a:1:{s:7:"visible";s:3:"all";}}}}s:7:"version";s:5:"5.0.2";}"
At first, I thought that this is in JSON. But later, I got that it is not in JSON. So, kindly help me to know in which format asol stores fields definition in asol_reports table. Also, if possible, kindly guide me to read this so programmatically I can fetch field names from this result. Thank you in advance

Is it possible to create T-SQL file containing mixed Arabic (right-to-left) and English?

I have a database that caters for English and Arabic, and normally these are separate and cause no issues. I have a requirement to mix them - and this is not a problem in the database using nvarchar and when the user directly inputs the values.
However, we can't give the user direct access to the DB, so we wanted to write a simple insert script (xxx.sql file) and get them to edit the values...but we are struggling!
In Word, you can change language/text direction fairly simply to get the correct message, but when c&p'd into a sql file (plain text) the direction and/or encoding get messed up :(
Does anyone know how to achieve this?
Let user use any text editor which can produce correct text file. This file should be not sql script but a file with comma separated values. Then you will be able to bulk import these values correctly into any database structure you need.

Get document ID for the template - Orbeon

I want to get the meta data from the template form. On the template form we have set meta data for some fields. We need this meta data to create a object which contains both the meta data, and the data that has been filled out, and create an object that contains these data.
When a user fill out a form, we only get the data a user has filled out. How can we achieve the meta data from the template.
In our database, I can see both the template and the filled out form have an unique ID, how can I pass this ID for the template, so I will receive it when the user has filled out the form, so I can look up the template form, and get the meta data?
Is there a way to get the ID for which template has been filled out? or can I pass the ID with the XML file, containing the filled out form?
The webservice is in grails (JAVA).
Best Regards
Daniel Knudsen

Paypal NVP can I pass multiple custom fields

I know I can pass a field name "CUSTOM" which is supposed to come back in IPN can I pass two values as for example CUSTOM0 and CUSTOM1? or something like that
You can't pass multiple fields, but you could pass multiple values in that 1 field if you need to. For example, you might include a value like...
val1|val2|val3|val4
Then in your IPN script, you could handle it like the following PHP sample...
$custom_values = explode('|',$_POST['custom']);
Then your custom values would all be available in the $custom_values array for you to use accordingly.
You could also send an NVP string or an XML string if that help you keep things straight, but keep in mind the CUSTOM parameter only accepts 256 characters.
If you need more than that, or if you just prefer, you could always save the data in a local database and then just pass a record ID in the CUSTOM field so that you can pull all those details back out of your database within your IPN script using that record ID.