fixed bug #1409972 PHP 5.1.2 compatibility
This commit is contained in:
@@ -103,7 +103,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
||||
// 2.2 Statement is a "SHOW..."
|
||||
elseif ($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 = array() );
|
||||
$tmp = preg_match('@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i', $GLOBALS['sql_query'], $which);
|
||||
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
|
||||
@@ -478,7 +478,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 = array());
|
||||
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches);
|
||||
$sort_expression_nodir = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
|
||||
|
||||
// sorting by indexes, only if it makes sense (only one table ref)
|
||||
@@ -740,7 +740,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:]]+)?' . strtr($fields_meta[$i]->name, array('[' => '\\[', '~' => '\\~', '\\' => '\\\\')) . '~i', $select_expr, $parts = array()))
|
||||
&& !preg_match('~([^[:space:],]|`[^`]`)[[:space:]]+(as[[:space:]]+)?' . strtr($fields_meta[$i]->name, array('[' => '\\[', '~' => '\\~', '\\' => '\\\\')) . '~i', $select_expr, $parts))
|
||||
|| ( isset($analyzed_sql[0]['select_expr'][$i]['expr'])
|
||||
&& isset($analyzed_sql[0]['select_expr'][$i]['column'])
|
||||
&& $analyzed_sql[0]['select_expr'][$i]['expr'] !=
|
||||
@@ -792,7 +792,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
$order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" 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 = array())) {
|
||||
if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@i', $unsorted_sql_query, $regs3)) {
|
||||
$sorted_sql_query = $regs3[1] . $sort_order . $regs3[2];
|
||||
} else {
|
||||
$sorted_sql_query = $unsorted_sql_query . $sort_order;
|
||||
|
Reference in New Issue
Block a user