patch #2407785 [cleanup] ereg*() deprecated in PHP 5.3
This commit is contained in:
@@ -21,6 +21,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
||||
- bug #1963184 [export] YAML export improvement,
|
||||
thanks to Bryce Thornton - brycethornton
|
||||
+ [lang] Dutch update, thanks to Herman van Rink - helmo
|
||||
- patch #2407785 [cleanup] ereg*() deprecated in PHP 5.3,
|
||||
thanks to Alex Frase - atfrase
|
||||
|
||||
3.1.1.0 (2008-12-09)
|
||||
- patch #2242765 [core] Navi panel server links wrong,
|
||||
|
@@ -175,7 +175,6 @@ class PMA_Config
|
||||
} elseif (preg_match('@OmniWeb/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) {
|
||||
$this->set('PMA_USR_BROWSER_VER', $log_version[1]);
|
||||
$this->set('PMA_USR_BROWSER_AGENT', 'OMNIWEB');
|
||||
//} elseif (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) {
|
||||
// Konqueror 2.2.2 says Konqueror/2.2.2
|
||||
// Konqueror 3.0.3 says Konqueror/3
|
||||
} elseif (preg_match('@(Konqueror/)(.*)(;)@', $HTTP_USER_AGENT, $log_version)) {
|
||||
|
@@ -499,10 +499,10 @@ require_once './libraries/List.class.php';
|
||||
// TODO: db names may contain characters
|
||||
// that are regexp instructions
|
||||
$re = '(^|(\\\\\\\\)+|[^\])';
|
||||
$tmp_regex = ereg_replace($re . '%', '\\1.*', ereg_replace($re . '_', '\\1.{1}', $tmp_matchpattern));
|
||||
$tmp_regex = preg_replace('/' . addcslashes($re,'/') . '%/', '\\1.*', preg_replace('/' . addcslashes($re,'/') . '_/', '\\1.{1}', $tmp_matchpattern));
|
||||
// Fixed db name matching
|
||||
// 2000-08-28 -- Benjamin Gandon
|
||||
if (ereg('^' . $tmp_regex . '$', $tmp_db)) {
|
||||
if (preg_match('/^' . addcslashes($tmp_regex,'/') . '$/', $tmp_db)) {
|
||||
$dblist[] = $tmp_db;
|
||||
break;
|
||||
}
|
||||
|
@@ -23,13 +23,13 @@ function Swekey_auth_check()
|
||||
$_SESSION['SWEKEY']['VALID_SWEKEYS'] = array();
|
||||
$valid_swekeys = split("\n",@file_get_contents($confFile));
|
||||
foreach ($valid_swekeys as $line) {
|
||||
if (ereg("^[0-9A-F]{32}:.+$", $line) != false)
|
||||
if (preg_match("/^[0-9A-F]{32}:.+$/", $line) != false)
|
||||
{
|
||||
$items = explode(":", $line);
|
||||
if (count($items) == 2)
|
||||
$_SESSION['SWEKEY']['VALID_SWEKEYS'][$items[0]] = trim($items[1]);
|
||||
}
|
||||
else if (ereg("^[A-Z_]+=.*$", $line) != false) {
|
||||
else if (preg_match("/^[A-Z_]+=.*$/", $line) != false) {
|
||||
$items = explode("=", $line);
|
||||
$_SESSION['SWEKEY']['CONF_'.trim($items[0])] = trim($items[1]);
|
||||
}
|
||||
|
@@ -179,7 +179,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
||||
} elseif ($row[$j] == '0' || $row[$j] != '') {
|
||||
// loic1 : always enclose fields
|
||||
if ($what == 'excel') {
|
||||
$row[$j] = ereg_replace("\015(\012)?", "\012", $row[$j]);
|
||||
$row[$j] = preg_replace("/\015(\012)?/", "\012", $row[$j]);
|
||||
}
|
||||
if ($csv_enclosed == '') {
|
||||
$schema_insert .= $row[$j];
|
||||
|
@@ -268,8 +268,8 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$type = $row['Type'];
|
||||
// reformat mysql query output - staybyte - 9. June 2001
|
||||
// loic1: set or enum types: slashes single quotes inside options
|
||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
if (preg_match('/^(set|enum)\((.+)\)$/i', $type, $tmp)) {
|
||||
$tmp[2] = substr(preg_replace('/([^,])\'\'/', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||
$type_nowrap = '';
|
||||
|
||||
@@ -278,16 +278,16 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$zerofill = 0;
|
||||
} else {
|
||||
$type_nowrap = ' nowrap="nowrap"';
|
||||
$type = eregi_replace('BINARY', '', $type);
|
||||
$type = eregi_replace('ZEROFILL', '', $type);
|
||||
$type = eregi_replace('UNSIGNED', '', $type);
|
||||
$type = preg_replace('/BINARY/i', '', $type);
|
||||
$type = preg_replace('/ZEROFILL/i', '', $type);
|
||||
$type = preg_replace('/UNSIGNED/i', '', $type);
|
||||
if (empty($type)) {
|
||||
$type = ' ';
|
||||
}
|
||||
|
||||
$binary = eregi('BINARY', $row['Type']);
|
||||
$unsigned = eregi('UNSIGNED', $row['Type']);
|
||||
$zerofill = eregi('ZEROFILL', $row['Type']);
|
||||
$binary = preg_match('/BINARY/i', $row['Type']);
|
||||
$unsigned = preg_match('/UNSIGNED/i', $row['Type']);
|
||||
$zerofill = preg_match('/ZEROFILL/i', $row['Type']);
|
||||
}
|
||||
$strAttribute = ' ';
|
||||
if ($binary) {
|
||||
|
@@ -395,8 +395,8 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$type = $row['Type'];
|
||||
// reformat mysql query output - staybyte - 9. June 2001
|
||||
// loic1: set or enum types: slashes single quotes inside options
|
||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
if (preg_match('/^(set|enum)\((.+)\)$/i', $type, $tmp)) {
|
||||
$tmp[2] = substr(preg_replace('/([^,])\'\'/', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||
$type_nowrap = '';
|
||||
|
||||
@@ -405,16 +405,16 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$zerofill = 0;
|
||||
} else {
|
||||
$type_nowrap = ' nowrap="nowrap"';
|
||||
$type = eregi_replace('BINARY', '', $type);
|
||||
$type = eregi_replace('ZEROFILL', '', $type);
|
||||
$type = eregi_replace('UNSIGNED', '', $type);
|
||||
$type = preg_replace('/BINARY/i', '', $type);
|
||||
$type = preg_replace('/ZEROFILL/i', '', $type);
|
||||
$type = preg_replace('/UNSIGNED/i', '', $type);
|
||||
if (empty($type)) {
|
||||
$type = ' ';
|
||||
}
|
||||
|
||||
$binary = eregi('BINARY', $row['Type']);
|
||||
$unsigned = eregi('UNSIGNED', $row['Type']);
|
||||
$zerofill = eregi('ZEROFILL', $row['Type']);
|
||||
$binary = preg_match('/BINARY/i', $row['Type']);
|
||||
$unsigned = preg_match('/UNSIGNED/i', $row['Type']);
|
||||
$zerofill = preg_match('/ZEROFILL/i', $row['Type']);
|
||||
}
|
||||
if (!isset($row['Default'])) {
|
||||
if ($row['Null'] != '') {
|
||||
|
@@ -331,8 +331,8 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
// loic1: set or enum types: slashes single quotes inside options
|
||||
$field_name = $row['Field'];
|
||||
$type = $row['Type'];
|
||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
if (preg_match('/^(set|enum)\((.+)\)$/i', $type, $tmp)) {
|
||||
$tmp[2] = substr(preg_replace('/([^,])\'\'/', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||
$type_nowrap = '';
|
||||
|
||||
@@ -341,16 +341,16 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$zerofill = 0;
|
||||
} else {
|
||||
$type_nowrap = ' nowrap="nowrap"';
|
||||
$type = eregi_replace('BINARY', '', $type);
|
||||
$type = eregi_replace('ZEROFILL', '', $type);
|
||||
$type = eregi_replace('UNSIGNED', '', $type);
|
||||
$type = preg_replace('/BINARY/i', '', $type);
|
||||
$type = preg_replace('/ZEROFILL/i', '', $type);
|
||||
$type = preg_replace('/UNSIGNED/i', '', $type);
|
||||
if (empty($type)) {
|
||||
$type = ' ';
|
||||
}
|
||||
|
||||
$binary = eregi('BINARY', $row['Type']);
|
||||
$unsigned = eregi('UNSIGNED', $row['Type']);
|
||||
$zerofill = eregi('ZEROFILL', $row['Type']);
|
||||
$binary = preg_match('/BINARY/i', $row['Type']);
|
||||
$unsigned = preg_match('/UNSIGNED/i', $row['Type']);
|
||||
$zerofill = preg_match('/ZEROFILL/i', $row['Type']);
|
||||
}
|
||||
$GLOBALS['odt_buffer'] .= '<table:table-cell office:value-type="string">'
|
||||
. '<text:p>' . htmlspecialchars($type) . '</text:p>'
|
||||
|
@@ -257,8 +257,8 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$type = $row['Type'];
|
||||
// reformat mysql query output - staybyte - 9. June 2001
|
||||
// loic1: set or enum types: slashes single quotes inside options
|
||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
if (preg_match('/^(set|enum)\((.+)\)$/i', $type, $tmp)) {
|
||||
$tmp[2] = substr(preg_replace('/([^,])\'\'/', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||
$type_nowrap = '';
|
||||
|
||||
@@ -267,16 +267,16 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
$zerofill = 0;
|
||||
} else {
|
||||
$type_nowrap = ' nowrap="nowrap"';
|
||||
$type = eregi_replace('BINARY', '', $type);
|
||||
$type = eregi_replace('ZEROFILL', '', $type);
|
||||
$type = eregi_replace('UNSIGNED', '', $type);
|
||||
$type = preg_replace('/BINARY/i', '', $type);
|
||||
$type = preg_replace('/ZEROFILL/i', '', $type);
|
||||
$type = preg_replace('/UNSIGNED/i', '', $type);
|
||||
if (empty($type)) {
|
||||
$type = ' ';
|
||||
}
|
||||
|
||||
$binary = eregi('BINARY', $row['Type']);
|
||||
$unsigned = eregi('UNSIGNED', $row['Type']);
|
||||
$zerofill = eregi('ZEROFILL', $row['Type']);
|
||||
$binary = preg_match('/BINARY/i', $row['Type']);
|
||||
$unsigned = preg_match('/UNSIGNED/i', $row['Type']);
|
||||
$zerofill = preg_match('/ZEROFILL/i', $row['Type']);
|
||||
}
|
||||
$strAttribute = ' ';
|
||||
if ($binary) {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* @uses opendir()
|
||||
* @uses readdir()
|
||||
* @uses is_file()
|
||||
* @uses eregi()
|
||||
* @uses preg_match()
|
||||
* @param string $plugins_dir directrory with plugins
|
||||
* @param mixed $plugin_param parameter to plugin by which they can decide whether they can work
|
||||
* @return array list of plugins
|
||||
|
@@ -145,8 +145,8 @@ function PMA_langDetect(&$str, $envType)
|
||||
if (strpos($expr, '[-_]') === FALSE) {
|
||||
$expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr);
|
||||
}
|
||||
if (($envType == 1 && eregi('^(' . $expr . ')(;q=[0-9]\\.[0-9])?$', $str))
|
||||
|| ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))', $str))) {
|
||||
if (($envType == 1 && preg_match('/^(' . addcslashes($expr,'/') . ')(;q=[0-9]\\.[0-9])?$/i', $str))
|
||||
|| ($envType == 2 && preg_match('/(\(|\[|;[[:space:]])(' . addcslashes($expr,'/') . ')(;|\]|\))/i', $str))) {
|
||||
if (PMA_langSet($lang)) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -2288,8 +2288,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
&& ($typearr[1] != 'punct_level_plus')
|
||||
&& (!PMA_STR_binarySearchInArr($arr[$i]['data'], $keywords_no_newline, $keywords_no_newline_cnt))) {
|
||||
// do not put a space before the first token, because
|
||||
// we use a lot of eregi() checking for the first
|
||||
// reserved word at beginning of query
|
||||
// we use a lot of pattern matching checking for the
|
||||
// first reserved word at beginning of query
|
||||
// so do not put a newline before
|
||||
//
|
||||
// also we must not be inside a privilege list
|
||||
|
@@ -5493,7 +5493,8 @@ if(!class_exists('TCPDF', false)) {
|
||||
if (isset($dash)) {
|
||||
$dash_string = "";
|
||||
if ($dash) {
|
||||
if (ereg("^.+,", $dash)) {
|
||||
// phpMyAdmin change
|
||||
if (preg_match("/^.+,/", $dash)) {
|
||||
$tab = explode(",", $dash);
|
||||
} else {
|
||||
$tab = array($dash);
|
||||
|
@@ -84,7 +84,7 @@ if (!empty($bug_encoded)) {
|
||||
$bug_encoded = stripslashes($bug_encoded);
|
||||
}
|
||||
|
||||
$bug_encoded = ereg_replace('[[:space:]]', '', $bug_encoded);
|
||||
$bug_encoded = preg_replace('/[[:space:]]/', '', $bug_encoded);
|
||||
$bug_decoded = base64_decode($bug_encoded);
|
||||
if (substr($bug_encoded, 0, 2) == 'eN') {
|
||||
if (function_exists('gzuncompress')) {
|
||||
|
Reference in New Issue
Block a user