mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
Save bytes ($connection->quote shortcut)
This commit is contained in:
@@ -22,8 +22,7 @@ function idf_unescape($idf) {
|
||||
* @return string
|
||||
*/
|
||||
function escape_string($val) {
|
||||
global $connection;
|
||||
return substr($connection->quote($val), 1, -1);
|
||||
return substr(q($val), 1, -1);
|
||||
}
|
||||
|
||||
/** Disable magic_quotes_gpc
|
||||
@@ -149,6 +148,11 @@ function ini_bool($ini) {
|
||||
return (eregi('^(on|true|yes)$', $val) || (int) $val); // boolean values set by php_value are strings
|
||||
}
|
||||
|
||||
function q($string) {
|
||||
global $connection;
|
||||
return $connection->quote($string);
|
||||
}
|
||||
|
||||
/** Get list of values from database
|
||||
* @param string
|
||||
* @param mixed
|
||||
@@ -609,7 +613,7 @@ function input($field, $value, $function) {
|
||||
* @return string
|
||||
*/
|
||||
function process_input($field) {
|
||||
global $connection, $adminer;
|
||||
global $adminer;
|
||||
$idf = bracket_escape($field["field"]);
|
||||
$function = $_POST["function"][$idf];
|
||||
$value = $_POST["fields"][$idf];
|
||||
@@ -639,7 +643,7 @@ function process_input($field) {
|
||||
if (!is_string($file)) {
|
||||
return false; //! report errors
|
||||
}
|
||||
return $connection->quote($file);
|
||||
return q($file);
|
||||
}
|
||||
return $adminer->processInput($field, $value, $function);
|
||||
}
|
||||
|
Reference in New Issue
Block a user