Mandatory $where in where()
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@440 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
a1ce56aadc
commit
9ea31125a0
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
header("Content-Type: application/octet-stream");
|
||||
echo $mysql->result($mysql->query("SELECT " . idf_escape($_GET["field"]) . " FROM " . idf_escape($_GET["download"]) . " WHERE " . implode(" AND ", where()) . " LIMIT 1"));
|
||||
echo $mysql->result($mysql->query("SELECT " . idf_escape($_GET["field"]) . " FROM " . idf_escape($_GET["download"]) . " WHERE " . implode(" AND ", where($_GET)) . " LIMIT 1"));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$where = where();
|
||||
$where = where($_GET);
|
||||
$fields = fields($_GET["edit"]);
|
||||
foreach ($fields as $name => $field) {
|
||||
if (isset($_GET["default"]) ? $field["auto_increment"] || preg_match('~text|blob~', $field["type"]) : !isset($field["privileges"][$where ? "update" : "insert"])) {
|
||||
|
|
|
@ -137,11 +137,8 @@ function unique_idf($row, $indexes) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function where($where = null) {
|
||||
function where($where) {
|
||||
global $mysql;
|
||||
if (!isset($where)) {
|
||||
$where = $_GET;
|
||||
}
|
||||
$return = array();
|
||||
foreach ((array) $where["where"] as $key => $val) {
|
||||
$return[] = idf_escape(bracket_escape($key, "back")) . " = BINARY '" . $mysql->escape_string($val) . "'"; //! enum and set
|
||||
|
|
Loading…
Reference in a new issue