Fix #314 - make sure where_clause is not modified
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
5364df21c6
commit
19df63b036
@ -3001,6 +3001,7 @@ class Results
|
||||
$_url_params = array(
|
||||
'db' => $this->__get('db'),
|
||||
'table' => $meta->orgtable,
|
||||
'where_clause_sign' => Core::signSqlQuery($whereClauseMap[$row_no][$meta->orgtable]),
|
||||
'where_clause' => $whereClauseMap[$row_no][$meta->orgtable],
|
||||
'transform_key' => $meta->orgname
|
||||
);
|
||||
|
||||
@ -18,6 +18,7 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PhpMyAdmin\Url;
|
||||
use PhpMyAdmin\Util;
|
||||
use PhpMyAdmin\Core;
|
||||
|
||||
/**
|
||||
* PhpMyAdmin\InsertEdit class
|
||||
@ -2480,6 +2481,7 @@ class InsertEdit
|
||||
$_url_params = array(
|
||||
'db' => $db,
|
||||
'table' => $table,
|
||||
'where_clause_sign' => Core::signSqlQuery($_POST['where_clause']),
|
||||
'where_clause' => $_POST['where_clause'],
|
||||
'transform_key' => $column_name
|
||||
);
|
||||
@ -3275,6 +3277,7 @@ class InsertEdit
|
||||
'db' => $db,
|
||||
'table' => $table,
|
||||
'transform_key' => $column['Field'],
|
||||
'where_clause_sign' => Core::signSqlQuery($where_clause),
|
||||
'where_clause' => $where_clause
|
||||
);
|
||||
$transformation_options['wrapper_link']
|
||||
|
||||
@ -63,6 +63,12 @@ foreach ($request_params as $one_request_param) {
|
||||
*/
|
||||
$GLOBALS['dbi']->selectDb($db);
|
||||
if (isset($where_clause)) {
|
||||
|
||||
if (! Core::checkSqlQuerySignature($where_clause, isset($_GET['where_clause_sign']) ? $_GET['where_clause_sign'] : '')) {
|
||||
/* l10n: In case a SQL query did not pass a security check */
|
||||
Core::fatalError(__('There is an issue with your request.'));
|
||||
exit;
|
||||
}
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SELECT * FROM ' . PhpMyAdmin\Util::backquote($table)
|
||||
. ' WHERE ' . $where_clause . ';',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user