diff --git a/ChangeLog b/ChangeLog index bd9f9d199..7739d53ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA 2.11.4.0 (not yet released) - bug #1843428 [GUI] Space issue with DROP/DELETE/ALTER TABLE +- bug #1807816 [search] regular expression search doesn't work with + backslashes 2.11.3.0 (not yet released) - patch #1818389 to remove a notice (failed to flush buffer), thanks to diff --git a/db_search.php b/db_search.php index c74610ba6..d24fba13e 100644 --- a/db_search.php +++ b/db_search.php @@ -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']);