fixed "backslashed backslash" before wildcards problem in databases names

This commit is contained in:
Loïc Chapeaux
2001-09-30 08:32:03 +00:00
parent caccd233a4
commit e24e60df46
2 changed files with 9 additions and 6 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-09-30 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/common.lib.php3, lines 489-493: fixed "backslashed backslash"
before wildcards problem in databases names.
2001-09-29 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/common.lib.php3:
- fixed a possible problem with invalid keys values in the $uva_mydbs

View File

@@ -486,12 +486,11 @@ if (!defined('__LIB_COMMON__')){
reset($uva_mydbs);
while (list($uva_matchpattern, $uva_value) = each($uva_mydbs)) {
// loic1: fixed bad regexp
// TODO: - slash before wildcards
// may be itself slashed
// - db names may contain
// characters that are
// regexp instructions
$uva_regex = ereg_replace('[^\]%', '.*', ereg_replace('[^\]_', '.{1}', $uva_value));
// TODO: db names may contain
// characters that are regexp
// instructions
$re = '(^|(\\\\\\\\)+|[^\])';
$uva_regex = ereg_replace($re . '%', '\\1.*', ereg_replace($re . '_', '\\1.{1}', $uva_value));
// Fixed db name matching
// 2000-08-28 -- Benjamin Gandon
if (ereg('^' . $uva_regex . '$', $uva_row[0])) {