- $sqlColumns[$key] = SQL_ESCAPE($columnName);
- $sqlValues[$key] = SQL_ESCAPE(postRequestElement($columnName));
-
- // Send data through the filter function if found
- if ((isset($filterFunctions[$key])) && (isset($extraValues[$key . '_list']))) {
- // Filter function set!
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
- $sqlValues[$key] = call_user_func_array($filterFunctions[$key], merge_array(array($columnName), $extraValues[$key . '_list']));
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
- } elseif ((isset($filterFunctions[$key])) && (!empty($filterFunctions[$key]))) {
- // Run through an extra filter
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
- $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], '');
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
+ $sqlColumns[$key] = sqlEscapeString($columnName);
+ $sqlValues[$key] = sqlEscapeString($value);
+
+ // Search for it
+ $search = key(search_array($columns, 'column', $columnName));
+
+ // Try to handle call-back functions and/or extra values on the list
+ //* DEBUG: */ outputHtml($key . '/' . $columnName . '=<pre>'.print_r($columns,true).'</pre>search_array()=<pre>'.print_r(search_array($columns, 'column', $columnName), TRUE).'</pre>');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '(' . gettype($key) . ')][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
+ if (is_string($key)) {
+ // Key is a string
+ $sqlValues[$key] = doHandleExtraValues($filterFunctions, $extraValues, $key . '_list', $sqlValues[$key], array(''), $search);
+ } else {
+ // Is a number
+ $sqlValues[$key] = doHandleExtraValues($filterFunctions, $extraValues, $key, $sqlValues[$key], array(''), $search);