bug #1807816 [search] regular expression search does not work with backslashes
This commit is contained in:
@@ -82,14 +82,6 @@ $search_options = array(
|
||||
'4' => $GLOBALS['strSearchOption4'],
|
||||
);
|
||||
|
||||
if (empty($_REQUEST['search_str']) || ! is_string($_REQUEST['search_str'])) {
|
||||
unset($_REQUEST['submit_search']);
|
||||
$searched = '';
|
||||
} else {
|
||||
$searched = htmlspecialchars($_REQUEST['search_str']);
|
||||
$search_str = PMA_sqlAddslashes($_REQUEST['search_str'], true);
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['search_option']) || ! is_string($_REQUEST['search_option'])
|
||||
|| ! array_key_exists($_REQUEST['search_option'], $search_options)) {
|
||||
$search_option = 1;
|
||||
@@ -99,6 +91,20 @@ if (empty($_REQUEST['search_option']) || ! is_string($_REQUEST['search_option'])
|
||||
$option_str = $search_options[$_REQUEST['search_option']];
|
||||
}
|
||||
|
||||
if (empty($_REQUEST['search_str']) || ! is_string($_REQUEST['search_str'])) {
|
||||
unset($_REQUEST['submit_search']);
|
||||
$searched = '';
|
||||
} else {
|
||||
$searched = htmlspecialchars($_REQUEST['search_str']);
|
||||
// For "as regular expression" (search option 4), we should not treat
|
||||
// this as an expression that contains a LIKE (second parameter of
|
||||
// PMA_sqlAddslashes()).
|
||||
//
|
||||
// Usage example: If user is seaching for a literal $ in a regexp search,
|
||||
// he should enter \$ as the value.
|
||||
$search_str = PMA_sqlAddslashes($_REQUEST['search_str'], ($search_option == 4 ? false : true));
|
||||
}
|
||||
|
||||
$tables_selected = array();
|
||||
if (empty($_REQUEST['table_select']) || ! is_array($_REQUEST['table_select'])) {
|
||||
unset($_REQUEST['submit_search']);
|
||||
|
Reference in New Issue
Block a user