1
0
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:
Jakub Vrana
2010-10-13 18:04:40 +02:00
parent b0d637b638
commit 7e644b4346
16 changed files with 89 additions and 123 deletions

View File

@@ -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);
}