patch #1253465, avoid error messages for unset variables in PHP functions that require a parameter passed by reference

This commit is contained in:
Marc Delisle
2005-08-14 21:34:01 +00:00
parent 80aecf6518
commit 7cf7ada8ac
8 changed files with 20 additions and 17 deletions

View File

@@ -11,6 +11,9 @@ $Source$
* libraries/common.lib.php, /display_tbl.lib.php, /functions.js, /grab_globals.lib.php:
patch #1257955 for bug #1248577 (incorrect message "you should define a primary key")
and bug #1253125 (request URI too large), thanks to Sebastian Mendel
* (many files): patch #1253465, avoid error messages for unset variables
in PHP functions that require a parameter passed by reference,
thanks to Sebastian Mendel
2005-08-12 Marc Delisle <lem9@users.sourceforge.net>
* header.inc.php: remove the 'InnoDB free' segment from table comments

View File

@@ -96,7 +96,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
// 2.2 Statement is a "SHOW..."
else if ($GLOBALS['is_show']) {
// 2.2.1 TODO : defines edit/delete links depending on show statement
$tmp = preg_match('@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i', $GLOBALS['sql_query'], $which);
$tmp = preg_match('@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i', $GLOBALS['sql_query'], $which = array() );
if (isset($which[1]) && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) {
$do_display['edit_lnk'] = 'nn'; // no edit link
$do_display['del_lnk'] = 'kp'; // "kill process" type edit link
@@ -474,7 +474,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$sort_expression = trim(str_replace(' ', ' ',$analyzed_sql[0]['order_by_clause']));
// Get rid of ASC|DESC (TODO: analyzer)
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si',$sort_expression,$matches);
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si',$sort_expression,$matches = array());
$sort_expression_nodir = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
// sorting by indexes, only if it makes sense (only one table ref)
@@ -753,7 +753,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// FROM `PMA_relation` AS `1` , `PMA_relation` AS `2`
if (($is_join
&& !preg_match('~([^[:space:],]|`[^`]`)[[:space:]]+(as[[:space:]]+)?' . $fields_meta[$i]->name . '~i', $select_expr, $parts))
&& !preg_match('~([^[:space:],]|`[^`]`)[[:space:]]+(as[[:space:]]+)?' . $fields_meta[$i]->name . '~i', $select_expr, $parts = array()))
|| ( isset($analyzed_sql[0]['select_expr'][$i]['expr'])
&& isset($analyzed_sql[0]['select_expr'][$i]['column'])
&& $analyzed_sql[0]['select_expr'][$i]['expr'] !=
@@ -807,7 +807,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_img = ' <img src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" border="0" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="soimg' . $i . '" />';
}
if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@i', $unsorted_sql_query, $regs3)) {
if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@i', $unsorted_sql_query, $regs3 = array())) {
$sorted_sql_query = $regs3[1] . $sort_order . $regs3[2];
} else {
$sorted_sql_query = $unsorted_sql_query . $sort_order;

View File

@@ -226,7 +226,7 @@ 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)) {
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp = array())) {
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
$type_nowrap = '';
@@ -243,9 +243,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
$type = '&nbsp;';
}
$binary = eregi('BINARY', $row['Type'], $test);
$unsigned = eregi('UNSIGNED', $row['Type'], $test);
$zerofill = eregi('ZEROFILL', $row['Type'], $test);
$binary = eregi('BINARY', $row['Type'], $test = array());
$unsigned = eregi('UNSIGNED', $row['Type'], $test = array());
$zerofill = eregi('ZEROFILL', $row['Type'], $test = array());
}
$strAttribute = '&nbsp;';
if ($binary) {

View File

@@ -315,7 +315,7 @@ 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)) {
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp = array())) {
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
$type_nowrap = '';
@@ -332,9 +332,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
$type = '&nbsp;';
}
$binary = eregi('BINARY', $row['Type'], $test);
$unsigned = eregi('UNSIGNED', $row['Type'], $test);
$zerofill = eregi('ZEROFILL', $row['Type'], $test);
$binary = eregi('BINARY', $row['Type'], $test = array());
$unsigned = eregi('UNSIGNED', $row['Type'], $test = array());
$zerofill = eregi('ZEROFILL', $row['Type'], $test = array());
}
$strAttribute = '&nbsp;';
if ($binary) {

View File

@@ -139,7 +139,7 @@ function PMA_getIp()
// True IP without proxy
return $direct_ip;
} else {
$is_ip = preg_match('|^([0-9]{1,3}\.){3,3}[0-9]{1,3}|', $proxy_ip, $regs);
$is_ip = preg_match('|^([0-9]{1,3}\.){3,3}[0-9]{1,3}|', $proxy_ip, $regs = array());
if ($is_ip && (count($regs) > 0)) {
// True IP behind a proxy
return $regs[0];
@@ -177,7 +177,7 @@ function PMA_ipMaskTest($testRange, $ipToTest)
{
$result = TRUE;
if (preg_match('|([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/([0-9]+)|', $testRange, $regs)) {
if (preg_match('|([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/([0-9]+)|', $testRange, $regs = array())) {
// performs a mask match
$ipl = ip2long($ipToTest);
$rangel = ip2long($regs[1] . '.' . $regs[2] . '.' . $regs[3] . '.' . $regs[4]);

View File

@@ -50,7 +50,7 @@ function PMA_getAvailableMIMEtypes() {
@ksort($filestack);
foreach ($filestack AS $key => $file) {
if (preg_match('|^.*__.*\.inc\.php(3?)$|', trim($file), $match)) {
if (preg_match('|^.*__.*\.inc\.php(3?)$|', trim($file), $match = array())) {
// File contains transformation functions.
$base = explode('__', str_replace('.inc.php' . $match[1], '', $file));

View File

@@ -67,7 +67,7 @@ function PMA_transformation_text_plain__external($buffer, $options = array(), $m
0 => array("pipe", "r"),
1 => array("pipe", "w")
);
$process = proc_open($program . ' ' . $poptions, $descriptorspec, $pipes);
$process = proc_open($program . ' ' . $poptions, $descriptorspec, $pipes = array());
if (is_resource($process)) {
fwrite($pipes[0], $buffer);
fclose($pipes[0]);

View File

@@ -1439,7 +1439,7 @@ function PMA_RT_DOC($alltables ){
$type = $row['Type'];
// reformat mysql query output - staybyte - 9. June 2001
// loic1: set or enum types: slashes single quotes inside options
if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp)) {
if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp = array())) {
$tmp[2] = substr(preg_replace("@([^,])''@", "\\1\\'", ',' . $tmp[2]), 1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
$type_nowrap = '';