The branch, QA_3_3 has been updated via 20d4c3a894a70850b9bcac57a3d63af68d40ec2e (commit) from 104b0ee99ac77845511c91dcaefe4f315c3c4435 (commit)
- Log ----------------------------------------------------------------- commit 20d4c3a894a70850b9bcac57a3d63af68d40ec2e Author: Marc Delisle marc@infomarc.info Date: Thu Jul 8 07:49:11 2010 -0400
bug #3026400 [PHP] ereg functions are deprecated
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + db_structure.php | 12 ++++++------ libraries/import.lib.php | 18 +++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 9da63ad..205dd32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug [js] Avoid loading twice a js file - bug #3024344 [setup] Setup forces numeric MemoryLimit - bug #3025975 [auth] Odd LoginCookieValidity default value +- bug #3026400 [PHP] ereg functions are deprecated
3.3.4.0 (2010-06-28) - bug #2996161 [import] properly escape import value diff --git a/db_structure.php b/db_structure.php index 845ffd3..2171ea5 100644 --- a/db_structure.php +++ b/db_structure.php @@ -349,26 +349,26 @@ foreach ($tables as $keyname => $each_table) {
$ignored = false; $do = false; - + if ($server_slave_status) { ////////////////////////////////////////////////////////////////
if ((strlen(array_search($truename, $server_slave_Do_Table)) > 0) - || (strlen(array_search($db, $server_slave_Do_DB))>0) - || (count($server_slave_Do_DB)==1 && count($server_slave_Ignore_DB)==1) + || (strlen(array_search($db, $server_slave_Do_DB)) > 0) + || (count($server_slave_Do_DB) == 1 && count($server_slave_Ignore_DB) == 1) ) { $do = true; } foreach ($server_slave_Wild_Do_Table as $table) { - if (($db == PMA_replication_strout($table)) && (ereg("^".substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true))-1), $truename))) + if (($db == PMA_replication_strout($table)) && (preg_match("@^" . substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true)) - 1) . "@", $truename))) $do = true; } //////////////////////////////////////////////////////////////////// - if ((strlen(array_search($truename, $server_slave_Ignore_Table))>0) || (strlen(array_search($db, $server_slave_Ignore_DB))>0)) { + if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { $ignored = true; } foreach ($server_slave_Wild_Ignore_Table as $table) { - if (($db == PMA_replication_strout($table)) && (ereg("^".substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true))-1), $truename))) + if (($db == PMA_replication_strout($table)) && (preg_match("@^" . substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true)) - 1) . "@", $truename))) $ignored = true; } }/* elseif ($server_master_status) { diff --git a/libraries/import.lib.php b/libraries/import.lib.php index 58f3fd1..56caeeb 100644 --- a/libraries/import.lib.php +++ b/libraries/import.lib.php @@ -840,8 +840,8 @@ $import_notice = NULL; * @uses SIZES * @uses strcmp() * @uses count() - * @uses ereg() - * @uses ereg_replace() + * @uses preg_match() + * @uses preg_replace() * @uses PMA_isView() * @uses PMA_backquote() * @uses PMA_importRunQuery() @@ -912,17 +912,17 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql = * * $pattern = 'CREATE (TABLE|VIEW|TRIGGER|FUNCTION|PROCEDURE)'; */ - $pattern = 'CREATE .*(TABLE)'; + $pattern = '/CREATE .*(TABLE)/'; $replacement = 'CREATE \1 IF NOT EXISTS';
/* Change CREATE statements to CREATE IF NOT EXISTS to support inserting into existing structures */ for ($i = 0; $i < $additional_sql_len; ++$i) { - $additional_sql[$i] = ereg_replace($pattern, $replacement, $additional_sql[$i]); + $additional_sql[$i] = preg_replace($pattern, $replacement, $additional_sql[$i]); /* Execute the resulting statements */ PMA_importRunQuery($additional_sql[$i], $additional_sql[$i]); } } - + if ($analyses != NULL) { $type_array = array(NONE => "NULL", VARCHAR => "varchar", INT => "int", DECIMAL => "decimal");
@@ -1047,8 +1047,8 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
/* Add the viewable structures from $additional_sql to $tables so they are also displayed */
- $view_pattern = 'VIEW `[^`]+`.`([^`]+)'; - $table_pattern = 'CREATE TABLE IF NOT EXISTS `([^`]+)`'; + $view_pattern = '@VIEW `[^`]+`.`([^`]+)@'; + $table_pattern = '@CREATE TABLE IF NOT EXISTS `([^`]+)`@'; /* Check a third pattern to make sure its not a "USE `db_name`;" statement */
$regs = array(); @@ -1057,10 +1057,10 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
$additional_sql_len = count($additional_sql); for ($i = 0; $i < $additional_sql_len; ++$i) { - ereg($view_pattern, $additional_sql[$i], $regs); + preg_match($view_pattern, $additional_sql[$i], $regs);
if (count($regs) == 0) { - ereg($table_pattern, $additional_sql[$i], $regs); + preg_match($table_pattern, $additional_sql[$i], $regs); }
if (count($regs)) {
hooks/post-receive