Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarvin Hicking <me@supergarv.de>2003-11-22 23:57:48 +0300
committerGarvin Hicking <me@supergarv.de>2003-11-22 23:57:48 +0300
commitc2b46ac9452b997ff61664e3f15a0f4e1367b1b2 (patch)
tree26f88dfa49345ad56261a93bf756941f99ddafe7 /read_dump.php
parent096094b74d73ae02aef352b8daafac0706b69078 (diff)
Final batch of PHP3-Compatibility fixes. Please test. :-)
Diffstat (limited to 'read_dump.php')
-rw-r--r--read_dump.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/read_dump.php b/read_dump.php
index bb12b9fdb9..41f981cc43 100644
--- a/read_dump.php
+++ b/read_dump.php
@@ -22,12 +22,12 @@ if (!isset($db)) {
/**
* Defines the url to return to in case of error in a sql statement
*/
-if (!isset($goto) || !eregi('^(db_details|tbl_properties)(_[a-z]*)?\.php$', $goto)) {
+if (!isset($goto) || !preg_match('@^(db_details|tbl_properties)(_[a-z]*)?\.php$@i', $goto)) {
$goto = 'db_details.php';
}
$err_url = $goto
. '?' . PMA_generate_common_url($db)
- . (eregi('^tbl_properties(_[a-z]*)?\.php$', $goto) ? '&amp;table=' . urlencode($table) : '');
+ . (preg_match('@^tbl_properties(_[a-z]*)?\.php$@', $goto) ? '&amp;table=' . urlencode($table) : '');
/**
@@ -54,11 +54,7 @@ if (!empty($id_bookmark)) {
case 0: // bookmarked query that have to be run
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
if (isset($bookmark_variable) && !empty($bookmark_variable)) {
- if (PMA_PHP_INT_VERSION >= 40300) {
- $sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $sql_query);
- } else {
- $sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '\1 ' . PMA_sqlAddslashes($bookmark_variable) . '\2', $sql_query);
- }
+ $sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $sql_query);
}
break;
case 1: // bookmarked query that have to be displayed
@@ -148,7 +144,7 @@ if (!empty($prev_sql_query)) {
// Drop database is not allowed -> ensure the query can be run
if (!$cfg['AllowUserDropDatabase']
- && eregi('DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE ', $sql_query)) {
+ && preg_match('@DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE @i', $sql_query)) {
// Checks if the user is a Superuser
// TODO: set a global variable with this information
// loic1: optimized query
@@ -240,7 +236,7 @@ if ($sql_query != '') {
// Only one query to run
if ($pieces_count == 1 && !empty($pieces[0])) {
$sql_query = $pieces[0];
- if (eregi('^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)', $sql_query)) {
+ if (preg_match('@^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $sql_query)) {
$reload = 1;
}
include('./sql.php');
@@ -255,7 +251,7 @@ if ($sql_query != '') {
for ($i = 0; $i < $pieces_count; $i++) {
$a_sql_query = $pieces[$i];
- if ($i == $pieces_count - 1 && eregi('^(SELECT|SHOW)', $a_sql_query)) {
+ if ($i == $pieces_count - 1 && preg_match('@^(SELECT|SHOW)@i', $a_sql_query)) {
$complete_query = $sql_query;
$display_query = $sql_query;
$sql_query = $a_sql_query;
@@ -300,7 +296,7 @@ if ($sql_query != '') {
$info_count++;
}
- if (!isset($reload) && eregi('^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)', $a_sql_query)) {
+ if (!isset($reload) && preg_match('@^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $a_sql_query)) {
$reload = 1;
}
} // end for
@@ -326,7 +322,7 @@ if (isset($my_die)) {
$js_to_run = 'functions.js';
include('./header.inc.php');
if (is_array($my_die)) {
- while(list($key, $die_string) = each($my_die)) {
+ foreach($my_die AS $key => $die_string) {
PMA_mysqlDie('', $die_string, '', $err_url, FALSE);
echo '<hr />';
}