Quote:
Originally Posted by Fou-Lu
What error is it throwing? Sounds to me that you didn't sanitize it prior to sending it. The integer 2 works in MySQL regardless of if its a string or an integer so long as the strict datatype mode isn't enforced.
Can't tell you how to fix it really since this is using a completely custom connection. Possibly a MySQLi under the hood? If so, just use prepared statements.
|
Thanks for the input, I have started to narrow down the issue. The code in question is generating a table of displaying data. Included are selected boxes acting as filters. The table construct is sent to javascript via json which then modifies the object when the user changes something and makes an ajax request call with the new object.
THE ISSUE: When grabbing the data from JSON an extra 10 chars have appeared when performing a check with strlen:
Code:
$data = json_decode(html_entity_decode(Core::$post->data),true);
$table = new Table(-1,-1);
$table->settings = $data['settings'];
$table->perPage = $data['perPage'];
$table->withSelected = $data['withSelected'];
$table->searchTypes = $data['searchTypes'];
foreach($data['columns'] as $column){
$table->AddColumn($column['header'], $column['fields']);
}
foreach($data['filters'] as $key => $filter){
echo strlen($filter['selected']) . "----72 "; //SHOULD ECHO 72---72 BUT ECHOS 82----72
$table->AddFilter($filter['label'],$filter['values'],$filter['selected']);
}
echo $table->Render();
The data is url-decoded by the systems core.