Fix CheckStyle warnings, Type:CloseBracketNewLine (Closing parenthesis of a multi-line IF statement must be on a new line)
This commit is contained in:
parent
67134da3d0
commit
4b8d52d937
@ -457,8 +457,9 @@ if ($db != 'mysql') {
|
||||
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
|
||||
// Don't allow to easily drop mysql database, RFE #1327514.
|
||||
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
|
||||
&& ! $db_is_information_schema
|
||||
&& (PMA_DRIZZLE || $db != 'mysql')) {
|
||||
&& ! $db_is_information_schema
|
||||
&& (PMA_DRIZZLE || $db != 'mysql')
|
||||
) {
|
||||
?>
|
||||
<div class="operations_half_width">
|
||||
<fieldset class="caution">
|
||||
|
||||
@ -254,7 +254,8 @@ for ($x = 0; $x < $col; $x++) {
|
||||
// then sorting is not available
|
||||
// Fix for Bug #570698
|
||||
if (isset($Sort[$x]) && isset($Field[$x])
|
||||
&& substr($Field[$x], -2) == '.*') {
|
||||
&& substr($Field[$x], -2) == '.*'
|
||||
) {
|
||||
$Sort[$x] = '';
|
||||
} //end if
|
||||
|
||||
|
||||
@ -366,7 +366,8 @@ class PMA_Config
|
||||
// find out if there is a .git folder
|
||||
$git_folder = '.git';
|
||||
if (! @file_exists($git_folder)
|
||||
|| ! @file_exists($git_folder . '/config')) {
|
||||
|| ! @file_exists($git_folder . '/config')
|
||||
) {
|
||||
$_SESSION['is_git_revision'] = false;
|
||||
return false;
|
||||
}
|
||||
@ -384,7 +385,8 @@ class PMA_Config
|
||||
// find out if there is a .git folder
|
||||
$git_folder = '.git';
|
||||
if (! @file_exists($git_folder)
|
||||
|| ! @file_exists($git_folder . '/config')) {
|
||||
|| ! @file_exists($git_folder . '/config')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +122,8 @@ class PMA_Theme_Manager
|
||||
|
||||
// check if user have a theme cookie
|
||||
if (! $this->getThemeCookie()
|
||||
|| ! $this->setActiveTheme($this->getThemeCookie())) {
|
||||
|| ! $this->setActiveTheme($this->getThemeCookie())
|
||||
) {
|
||||
// otherwise use default theme
|
||||
if ($GLOBALS['cfg']['ThemeDefault']) {
|
||||
$this->setActiveTheme($GLOBALS['cfg']['ThemeDefault']);
|
||||
@ -136,7 +137,8 @@ class PMA_Theme_Manager
|
||||
function checkConfig()
|
||||
{
|
||||
if ($this->_themes_path != trim($GLOBALS['cfg']['ThemePath'])
|
||||
|| $this->theme_default != $GLOBALS['cfg']['ThemeDefault']) {
|
||||
|| $this->theme_default != $GLOBALS['cfg']['ThemeDefault']
|
||||
) {
|
||||
$this->init();
|
||||
} else {
|
||||
// at least the theme path needs to be checked every time for new
|
||||
|
||||
@ -128,7 +128,8 @@ function PMA_auth()
|
||||
|
||||
/* Perform logout to custom URL */
|
||||
if (! empty($_REQUEST['old_usr'])
|
||||
&& ! empty($GLOBALS['cfg']['Server']['LogoutURL'])) {
|
||||
&& ! empty($GLOBALS['cfg']['Server']['LogoutURL'])
|
||||
) {
|
||||
PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']);
|
||||
exit;
|
||||
}
|
||||
@ -414,7 +415,8 @@ function PMA_auth_check()
|
||||
|
||||
// servername
|
||||
if ($GLOBALS['cfg']['AllowArbitraryServer']
|
||||
&& ! empty($_COOKIE['pmaServer-' . $GLOBALS['server']])) {
|
||||
&& ! empty($_COOKIE['pmaServer-' . $GLOBALS['server']])
|
||||
) {
|
||||
$GLOBALS['pma_auth_server'] = $_COOKIE['pmaServer-' . $GLOBALS['server']];
|
||||
}
|
||||
|
||||
@ -481,11 +483,12 @@ function PMA_auth_set_user()
|
||||
if ($cfg['Server']['user'] != $GLOBALS['PHP_AUTH_USER']) {
|
||||
foreach ($cfg['Servers'] as $idx => $current) {
|
||||
if ($current['host'] == $cfg['Server']['host']
|
||||
&& $current['port'] == $cfg['Server']['port']
|
||||
&& $current['socket'] == $cfg['Server']['socket']
|
||||
&& $current['ssl'] == $cfg['Server']['ssl']
|
||||
&& $current['connect_type'] == $cfg['Server']['connect_type']
|
||||
&& $current['user'] == $GLOBALS['PHP_AUTH_USER']) {
|
||||
&& $current['port'] == $cfg['Server']['port']
|
||||
&& $current['socket'] == $cfg['Server']['socket']
|
||||
&& $current['ssl'] == $cfg['Server']['ssl']
|
||||
&& $current['connect_type'] == $cfg['Server']['connect_type']
|
||||
&& $current['user'] == $GLOBALS['PHP_AUTH_USER']
|
||||
) {
|
||||
$GLOBALS['server'] = $idx;
|
||||
$cfg['Server'] = $current;
|
||||
break;
|
||||
@ -494,7 +497,8 @@ function PMA_auth_set_user()
|
||||
} // end if
|
||||
|
||||
if ($GLOBALS['cfg']['AllowArbitraryServer']
|
||||
&& ! empty($GLOBALS['pma_auth_server'])) {
|
||||
&& ! empty($GLOBALS['pma_auth_server'])
|
||||
) {
|
||||
/* Allow to specify 'host port' */
|
||||
$parts = explode(' ', $GLOBALS['pma_auth_server']);
|
||||
if (count($parts) == 2) {
|
||||
|
||||
@ -158,7 +158,8 @@ function PMA_auth_check()
|
||||
|
||||
// User logged out -> ensure the new username is not the same
|
||||
if (!empty($old_usr)
|
||||
&& (isset($PHP_AUTH_USER) && $old_usr == $PHP_AUTH_USER)) {
|
||||
&& (isset($PHP_AUTH_USER) && $old_usr == $PHP_AUTH_USER)
|
||||
) {
|
||||
$PHP_AUTH_USER = '';
|
||||
// -> delete user's choices that were stored in session
|
||||
session_destroy();
|
||||
@ -197,7 +198,9 @@ function PMA_auth_set_user()
|
||||
$servers_cnt = count($cfg['Servers']);
|
||||
for ($i = 1; $i <= $servers_cnt; $i++) {
|
||||
if (isset($cfg['Servers'][$i])
|
||||
&& ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] && $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)) {
|
||||
&& ($cfg['Servers'][$i]['host'] == $cfg['Server']['host']
|
||||
&& $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)
|
||||
) {
|
||||
$server = $i;
|
||||
$cfg['Server'] = $cfg['Servers'][$i];
|
||||
break;
|
||||
|
||||
@ -819,7 +819,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
if (isset($GLOBALS['collation_connection'])) {
|
||||
$GLOBALS['PMA_Config']->setCookie(
|
||||
'pma_collation_connection',
|
||||
$GLOBALS['collation_connection']);
|
||||
$GLOBALS['collation_connection']
|
||||
);
|
||||
}
|
||||
|
||||
$_SESSION['PMA_Theme_Manager']->setThemeCookie();
|
||||
|
||||
@ -3026,10 +3026,9 @@ function PMA_extractColumnSpec($columnspec)
|
||||
}
|
||||
|
||||
$can_contain_collation = false;
|
||||
if (
|
||||
! $binary
|
||||
&&
|
||||
preg_match("@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@", $type)) {
|
||||
if (! $binary
|
||||
&& preg_match("@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@", $type)
|
||||
) {
|
||||
$can_contain_collation = true;
|
||||
}
|
||||
|
||||
|
||||
@ -221,9 +221,10 @@ class ConfigFile
|
||||
$this->orgCfgObject->settings
|
||||
);
|
||||
if (($value === $default_value && (defined('PMA_SETUP')
|
||||
|| $instance_default_value === $default_value))
|
||||
|| (empty($value) && empty($default_value) && (defined('PMA_SETUP')
|
||||
|| empty($current_global)))) {
|
||||
|| $instance_default_value === $default_value))
|
||||
|| (empty($value) && empty($default_value) && (defined('PMA_SETUP')
|
||||
|| empty($current_global)))
|
||||
) {
|
||||
PMA_array_remove($path, $_SESSION[$this->id]);
|
||||
return;
|
||||
}
|
||||
@ -452,7 +453,8 @@ class ConfigFile
|
||||
unset($_SESSION[$this->id]['Servers'][$last_server]);
|
||||
|
||||
if (isset($_SESSION[$this->id]['ServerDefault'])
|
||||
&& $_SESSION[$this->id]['ServerDefault'] >= 0) {
|
||||
&& $_SESSION[$this->id]['ServerDefault'] >= 0
|
||||
) {
|
||||
unset($_SESSION[$this->id]['ServerDefault']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,7 +449,8 @@ class FormDisplay
|
||||
// equality comparison only if both values are numeric or not numeric
|
||||
// (allows to skip 0 == 'string' equalling to true) or identity (for string-string)
|
||||
if (($vk == $value && !(is_numeric($value_cmp) xor is_numeric($vk)))
|
||||
|| $vk === $value) {
|
||||
|| $vk === $value
|
||||
) {
|
||||
// keep boolean value as boolean
|
||||
if (!is_bool($value)) {
|
||||
settype($value, gettype($vk));
|
||||
@ -521,7 +522,8 @@ class FormDisplay
|
||||
// user preferences allow/disallow
|
||||
if ($is_setup_script && isset($this->userprefs_keys[$system_path])) {
|
||||
if (isset($this->userprefs_disallow[$system_path])
|
||||
&& isset($_POST[$key . '-userprefs-allow'])) {
|
||||
&& isset($_POST[$key . '-userprefs-allow'])
|
||||
) {
|
||||
unset($this->userprefs_disallow[$system_path]);
|
||||
} else if (!isset($_POST[$key . '-userprefs-allow'])) {
|
||||
$this->userprefs_disallow[$system_path] = true;
|
||||
@ -760,7 +762,8 @@ class FormDisplay
|
||||
}
|
||||
if (!defined('PMA_SETUP')) {
|
||||
if (($system_path == 'MaxDbList' || $system_path == 'MaxTableList'
|
||||
|| $system_path == 'QueryHistoryMax')) {
|
||||
|| $system_path == 'QueryHistoryMax')
|
||||
) {
|
||||
$opts['comment'] = sprintf(__('maximum %s'), $GLOBALS['cfg'][$system_path]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,7 +382,8 @@ function validate_trusted_proxies($path, $values)
|
||||
}
|
||||
// now let's check whether we really have an IP address
|
||||
if (filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false
|
||||
&& filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
|
||||
&& filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false
|
||||
) {
|
||||
$ip = htmlspecialchars(trim($matches[1]));
|
||||
$result[$path][] = sprintf(__('Incorrect IP address: %s'), $ip);
|
||||
continue;
|
||||
|
||||
@ -236,7 +236,8 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
||||
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
|
||||
echo '<option value="' . htmlentities($temp_charset) . '"';
|
||||
if ((empty($cfg['Import']['charset']) && $temp_charset == 'utf-8')
|
||||
|| $temp_charset == $cfg['Import']['charset']) {
|
||||
|| $temp_charset == $cfg['Import']['charset']
|
||||
) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo '>' . htmlentities($temp_charset) . '</option>';
|
||||
|
||||
@ -81,7 +81,8 @@ function PMA_import_sessionCheck()
|
||||
{
|
||||
if (PMA_PHP_INT_VERSION < 50400
|
||||
|| ! ini_get('session.upload_progress.enabled')
|
||||
|| ! function_exists('curl_exec')) {
|
||||
|| ! function_exists('curl_exec')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -234,9 +234,11 @@ while (!($finished && $i >= $len) && !$error && !$timeout_passed) {
|
||||
}
|
||||
$i++;
|
||||
$ch = $buffer[$i];
|
||||
if ($csv_enclosed == $csv_escaped && ($ch == $csv_terminated
|
||||
|| $ch == $csv_new_line || ($csv_new_line == 'auto'
|
||||
&& ($ch == "\r" || $ch == "\n")))) {
|
||||
if ($csv_enclosed == $csv_escaped
|
||||
&& ($ch == $csv_terminated
|
||||
|| $ch == $csv_new_line
|
||||
|| ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n")))
|
||||
) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,8 @@ $cfgRelation = PMA_getRelationsParam();
|
||||
* We need relations enabled and we work only on database
|
||||
*/
|
||||
if ($plugin_param !== 'database' || $GLOBALS['num_tables'] < 1
|
||||
|| ! $cfgRelation['relwork'] || ! $cfgRelation['commwork']) {
|
||||
|| ! $cfgRelation['relwork'] || ! $cfgRelation['commwork']
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -218,7 +218,8 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) {
|
||||
// Not enough data to decide
|
||||
if ((($i == ($len - 1) && ($ch == '-' || $ch == '/'))
|
||||
|| ($i == ($len - 2) && (($ch == '-' && $buffer[$i + 1] == '-')
|
||||
|| ($ch == '/' && $buffer[$i + 1] == '*')))) && !$GLOBALS['finished']) {
|
||||
|| ($ch == '/' && $buffer[$i + 1] == '*')))) && !$GLOBALS['finished']
|
||||
) {
|
||||
break;
|
||||
}
|
||||
|
||||
@ -228,7 +229,7 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) {
|
||||
&& (($i < ($len - 2) && $buffer[$i + 2] <= ' ')
|
||||
|| ($i == ($len - 1) && $GLOBALS['finished'])))
|
||||
|| ($i < ($len - 1) && $ch == '/' && $buffer[$i + 1] == '*')
|
||||
) {
|
||||
) {
|
||||
// Copy current string to SQL
|
||||
if ($start_pos != $i) {
|
||||
$sql .= substr($buffer, $start_pos, $i - $start_pos);
|
||||
|
||||
@ -318,7 +318,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
if (($c == '#')
|
||||
|| (($count2 + 1 < $len) && ($c == '/') && ($next_c == '*'))
|
||||
|| (($count2 + 2 == $len) && ($c == '-') && ($next_c == '-'))
|
||||
|| (($count2 + 2 < $len) && ($c == '-') && ($next_c == '-') && ((PMA_substr($sql, $count2 + 2, 1) <= ' ')))) {
|
||||
|| (($count2 + 2 < $len) && ($c == '-') && ($next_c == '-') && ((PMA_substr($sql, $count2 + 2, 1) <= ' ')))
|
||||
) {
|
||||
$count2++;
|
||||
$pos = 0;
|
||||
$type = 'bad';
|
||||
@ -476,8 +477,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
|| $c == '@'
|
||||
|| ($c == '.'
|
||||
&& PMA_STR_isDigit(PMA_substr($sql, $count2 + 1, 1))
|
||||
&& ($previous_was_space || $previous_was_bracket || $previous_was_listsep))) {
|
||||
|
||||
&& ($previous_was_space || $previous_was_bracket || $previous_was_listsep))
|
||||
) {
|
||||
/* DEBUG
|
||||
echo PMA_substr($sql, $count2);
|
||||
echo '<hr />';
|
||||
@ -782,7 +783,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
|| ($d_bef_prev_upper == 'SET' && $d_prev_upper == '=')
|
||||
|| ($d_bef_prev_upper == 'CHARSET' && $d_prev_upper == '=')
|
||||
|| $d_prev_upper == 'CHARSET'
|
||||
) && in_array($d_cur, $mysql_charsets)) {
|
||||
) && in_array($d_cur, $mysql_charsets)
|
||||
) {
|
||||
$t_suffix = '_charset';
|
||||
}
|
||||
} elseif (in_array($d_cur, $mysql_charsets)
|
||||
@ -1173,8 +1175,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
|| $arr[$i]['type'] == 'quote_single'
|
||||
|| $arr[$i]['type'] == 'alpha_identifier'
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord'
|
||||
&& $arr[$i]['forbidden'] == false)) {
|
||||
|
||||
&& $arr[$i]['forbidden'] == false)
|
||||
) {
|
||||
switch ($arr[$i]['type']) {
|
||||
case 'alpha_identifier':
|
||||
case 'alpha_reservedWord':
|
||||
@ -1196,8 +1198,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
} // end switch
|
||||
|
||||
if ($subresult['querytype'] == 'SELECT'
|
||||
&& ! $in_group_concat
|
||||
&& ! ($seen_subquery && $arr[$i - 1]['type'] == 'punct_bracket_close_round')) {
|
||||
&& ! $in_group_concat
|
||||
&& ! ($seen_subquery && $arr[$i - 1]['type'] == 'punct_bracket_close_round')
|
||||
) {
|
||||
if (!$seen_from) {
|
||||
if ($previous_was_identifier && isset($chain)) {
|
||||
// found alias for this select_expr, save it
|
||||
@ -1250,8 +1253,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
// the "*" is not saved
|
||||
|
||||
if (isset($chain) && !$seen_end_of_table_ref
|
||||
&& ((!$seen_from && $arr[$i]['type'] == 'punct_listsep')
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord' && $upper_data == 'FROM'))) {
|
||||
&& ((!$seen_from && $arr[$i]['type'] == 'punct_listsep')
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord' && $upper_data == 'FROM'))
|
||||
) {
|
||||
$size_chain = count($chain);
|
||||
$current_select_expr++;
|
||||
$subresult['select_expr'][$current_select_expr] = array(
|
||||
@ -1295,7 +1299,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
* @todo explain this:
|
||||
*/
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data != 'FROM')) {
|
||||
&& ($upper_data != 'FROM')
|
||||
) {
|
||||
$previous_was_identifier = true;
|
||||
}
|
||||
|
||||
@ -1318,7 +1323,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
&& ($arr[$i]['type'] == 'punct_listsep'
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord' && $upper_data!="AS")
|
||||
|| $seen_end_of_table_ref
|
||||
|| $i==$size-1)) {
|
||||
|| $i==$size-1)
|
||||
) {
|
||||
|
||||
$size_chain = count($chain);
|
||||
$current_table_ref++;
|
||||
@ -1382,25 +1388,29 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
// set the $previous_was_identifier to false if the current
|
||||
// token is not an identifier
|
||||
if (($arr[$i]['type'] != 'alpha_identifier')
|
||||
&& ($arr[$i]['type'] != 'quote_double')
|
||||
&& ($arr[$i]['type'] != 'quote_single')
|
||||
&& ($arr[$i]['type'] != 'quote_backtick')) {
|
||||
&& ($arr[$i]['type'] != 'quote_double')
|
||||
&& ($arr[$i]['type'] != 'quote_single')
|
||||
&& ($arr[$i]['type'] != 'quote_backtick')
|
||||
) {
|
||||
$previous_was_identifier = false;
|
||||
} // end if
|
||||
|
||||
// however, if we are on AS, we must keep the $previous_was_identifier
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data == 'AS')) {
|
||||
&& ($upper_data == 'AS')
|
||||
) {
|
||||
$previous_was_identifier = true;
|
||||
}
|
||||
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data =='ON' || $upper_data =='USING')) {
|
||||
&& ($upper_data =='ON' || $upper_data =='USING')
|
||||
) {
|
||||
$save_table_ref = false;
|
||||
} // end if (data == ON)
|
||||
|
||||
if (($arr[$i]['type'] == 'alpha_reservedWord')
|
||||
&& ($upper_data =='JOIN' || $upper_data =='FROM')) {
|
||||
&& ($upper_data =='JOIN' || $upper_data =='FROM')
|
||||
) {
|
||||
$save_table_ref = true;
|
||||
} // end if (data == JOIN)
|
||||
|
||||
@ -1420,9 +1430,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
// but it's a modifier of the GROUP_CONCAT so
|
||||
// it's not the real end of table refs
|
||||
if (($i == $size-1)
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord'
|
||||
&& !$in_group_concat
|
||||
&& isset($words_ending_table_ref[$upper_data]))) {
|
||||
|| ($arr[$i]['type'] == 'alpha_reservedWord'
|
||||
&& !$in_group_concat
|
||||
&& isset($words_ending_table_ref[$upper_data]))
|
||||
) {
|
||||
$seen_end_of_table_ref = true;
|
||||
// to be able to save the last table ref, but do not
|
||||
// set it true if we found a word like "ON" that has
|
||||
@ -1538,8 +1549,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
// if the first reserved word is DROP or DELETE,
|
||||
// we know this is a query that needs to be confirmed
|
||||
if ($first_reserved_word=='DROP'
|
||||
|| $first_reserved_word == 'DELETE'
|
||||
|| $first_reserved_word == 'TRUNCATE') {
|
||||
|| $first_reserved_word == 'DELETE'
|
||||
|| $first_reserved_word == 'TRUNCATE'
|
||||
) {
|
||||
$subresult['queryflags']['need_confirm'] = 1;
|
||||
}
|
||||
|
||||
@ -1741,21 +1753,24 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
$where_clause .= $arr[$i]['data'] . $sep;
|
||||
|
||||
if (($arr[$i]['type'] == 'quote_backtick')
|
||||
|| ($arr[$i]['type'] == 'alpha_identifier')) {
|
||||
|| ($arr[$i]['type'] == 'alpha_identifier')
|
||||
) {
|
||||
$where_clause_identifiers[] = $arr[$i]['data'];
|
||||
}
|
||||
}
|
||||
|
||||
// to grab the rest of the query after the ORDER BY clause
|
||||
if (isset($subresult['queryflags']['select_from'])
|
||||
&& $subresult['queryflags']['select_from'] == 1
|
||||
&& ! $in_order_by
|
||||
&& $seen_order_by
|
||||
&& $upper_data != 'BY') {
|
||||
&& $subresult['queryflags']['select_from'] == 1
|
||||
&& ! $in_order_by
|
||||
&& $seen_order_by
|
||||
&& $upper_data != 'BY'
|
||||
) {
|
||||
$unsorted_query .= $arr[$i]['data'];
|
||||
if ($arr[$i]['type'] != 'punct_bracket_open_round'
|
||||
&& $arr[$i]['type'] != 'punct_bracket_close_round'
|
||||
&& $arr[$i]['type'] != 'punct') {
|
||||
&& $arr[$i]['type'] != 'punct_bracket_close_round'
|
||||
&& $arr[$i]['type'] != 'punct'
|
||||
) {
|
||||
$unsorted_query .= $sep;
|
||||
}
|
||||
}
|
||||
@ -1875,7 +1890,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
$clause = 'on_update';
|
||||
}
|
||||
if (isset($clause)
|
||||
&& ($arr[$i+2]['type'] == 'alpha_reservedWord'
|
||||
&& ($arr[$i+2]['type'] == 'alpha_reservedWord'
|
||||
|
||||
// ugly workaround because currently, NO is not
|
||||
// in the list of reserved words in sqlparser.data
|
||||
@ -1886,16 +1901,19 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
) {
|
||||
$third_upper_data = strtoupper($arr[$i+2]['data']);
|
||||
if ($third_upper_data == 'CASCADE'
|
||||
|| $third_upper_data == 'RESTRICT') {
|
||||
|| $third_upper_data == 'RESTRICT'
|
||||
) {
|
||||
$value = $third_upper_data;
|
||||
} elseif ($third_upper_data == 'SET'
|
||||
|| $third_upper_data == 'NO') {
|
||||
|| $third_upper_data == 'NO'
|
||||
) {
|
||||
if ($arr[$i+3]['type'] == 'alpha_reservedWord') {
|
||||
$value = $third_upper_data . '_' . strtoupper($arr[$i+3]['data']);
|
||||
}
|
||||
} elseif ($third_upper_data == 'CURRENT_TIMESTAMP') {
|
||||
if ($clause == 'on_update'
|
||||
&& $in_timestamp_options) {
|
||||
&& $in_timestamp_options
|
||||
) {
|
||||
$create_table_fields[$current_identifier]['on_update_current_timestamp'] = true;
|
||||
$seen_default = false;
|
||||
}
|
||||
@ -2288,8 +2306,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
break;
|
||||
case 'punct':
|
||||
$before .= ' ';
|
||||
if ($docu && isset($PMA_SQPdata_operators_docs[$arr[$i]['data']]) &&
|
||||
($arr[$i]['data'] != '*' || in_array($arr[$i]['type'], array('digit_integer','digit_float','digit_hex')))) {
|
||||
if ($docu && isset($PMA_SQPdata_operators_docs[$arr[$i]['data']])
|
||||
&& ($arr[$i]['data'] != '*' || in_array($arr[$i]['type'], array('digit_integer','digit_float','digit_hex')))
|
||||
) {
|
||||
$before .= PMA_showMySQLDocu(
|
||||
'functions',
|
||||
$PMA_SQPdata_operators_docs[$arr[$i]['data']]['link'],
|
||||
@ -2399,7 +2418,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
// binary is marked as alpha_columnAttrib
|
||||
// but should be marked as a reserved word
|
||||
if (strtoupper($arr[$i]['data']) == 'BINARY'
|
||||
&& $typearr[3] == 'alpha_identifier') {
|
||||
&& $typearr[3] == 'alpha_identifier'
|
||||
) {
|
||||
$after .= ' ';
|
||||
}
|
||||
break;
|
||||
@ -2431,7 +2451,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
|| (($typearr[1] == 'alpha_reservedWord')
|
||||
&& isset($keywords_no_newline[strtoupper($arr[$i - 1]['data'])])))
|
||||
&& ($typearr[1] != 'punct_level_plus')
|
||||
&& (!isset($keywords_no_newline[$arr[$i]['data']]))) {
|
||||
&& (!isset($keywords_no_newline[$arr[$i]['data']]))
|
||||
) {
|
||||
// do not put a space before the first token, because
|
||||
// we use a lot of pattern matching checking for the
|
||||
// first reserved word at beginning of query
|
||||
|
||||
@ -63,7 +63,8 @@ function PMA_validateSQL($sql)
|
||||
|
||||
if ($cfg['SQLValidator']['use']) {
|
||||
if (isset($GLOBALS['sqlvalidator_error'])
|
||||
&& $GLOBALS['sqlvalidator_error']) {
|
||||
&& $GLOBALS['sqlvalidator_error']
|
||||
) {
|
||||
$str = sprintf(__('The SQL validator could not be initialized. Please check if you have installed the necessary PHP extensions as described in the %sdocumentation%s.'), '<a href="Documentation.html#faqsqlvalidator" target="documentation">', '</a>');
|
||||
} else {
|
||||
// create new class instance
|
||||
|
||||
@ -354,8 +354,9 @@ for ($i = 0; $i < $num_fields; $i++) {
|
||||
|
||||
// for a TIMESTAMP, do not show the string "CURRENT_TIMESTAMP" as a default value
|
||||
if ($type_upper == 'TIMESTAMP'
|
||||
&& ! empty($default_current_timestamp)
|
||||
&& isset($row['Default'])) {
|
||||
&& ! empty($default_current_timestamp)
|
||||
&& isset($row['Default'])
|
||||
) {
|
||||
$row['Default'] = '';
|
||||
}
|
||||
|
||||
@ -411,22 +412,25 @@ for ($i = 0; $i < $num_fields; $i++) {
|
||||
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
|
||||
// the latter.
|
||||
if (PMA_MYSQL_INT_VERSION < 50025
|
||||
&& isset($row['Field'])
|
||||
&& isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['type'])
|
||||
&& $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP'
|
||||
&& $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null'] == true) {
|
||||
&& isset($row['Field'])
|
||||
&& isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['type'])
|
||||
&& $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP'
|
||||
&& $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null'] == true
|
||||
) {
|
||||
$row['Null'] = '';
|
||||
}
|
||||
|
||||
// MySQL 4.1.2+ TIMESTAMP options
|
||||
// (if on_update_current_timestamp is set, then it's TRUE)
|
||||
if (isset($row['Field'])
|
||||
&& isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) {
|
||||
&& isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])
|
||||
) {
|
||||
$attribute = 'on update CURRENT_TIMESTAMP';
|
||||
}
|
||||
if ((isset($row['Field'])
|
||||
&& isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp']))
|
||||
|| (isset($submit_default_current_timestamp) && $submit_default_current_timestamp)) {
|
||||
&& isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp']))
|
||||
|| (isset($submit_default_current_timestamp) && $submit_default_current_timestamp)
|
||||
) {
|
||||
$default_current_timestamp = true;
|
||||
} else {
|
||||
$default_current_timestamp = false;
|
||||
|
||||
20
main.php
20
main.php
@ -56,7 +56,7 @@ if ($server > 0) {
|
||||
$server_info .= PMA_DBI_get_host_info();
|
||||
}
|
||||
if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
|
||||
$server_info .= ')';
|
||||
$server_info .= ')';
|
||||
}
|
||||
$mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
|
||||
|
||||
@ -69,7 +69,8 @@ if ($server > 0) {
|
||||
echo '<div id="maincontainer">' . "\n";
|
||||
echo '<div id="main_pane_left">';
|
||||
if ($server > 0
|
||||
|| (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)) {
|
||||
|| (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)
|
||||
) {
|
||||
echo '<div class="group">';
|
||||
echo '<h2>' . __('General Settings') . '</h2>';
|
||||
echo '<ul>';
|
||||
@ -78,7 +79,8 @@ if ($server > 0
|
||||
* Displays the MySQL servers choice form
|
||||
*/
|
||||
if (! $cfg['LeftDisplayServers']
|
||||
&& (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)) {
|
||||
&& (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)
|
||||
) {
|
||||
echo '<li id="li_select_server">';
|
||||
include_once 'libraries/select_server.lib.php';
|
||||
PMA_select_server(true, true);
|
||||
@ -219,7 +221,7 @@ if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) {
|
||||
);
|
||||
PMA_printListItem(
|
||||
__('PHP extension') . ': ' . $GLOBALS['cfg']['Server']['extension']. ' '
|
||||
. PMA_showPHPDocu('book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'),
|
||||
. PMA_showPHPDocu('book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'),
|
||||
'li_used_php_extension'
|
||||
);
|
||||
}
|
||||
@ -271,8 +273,9 @@ PMA_printListItem(__('List of changes'), 'li_pma_changes', PMA_linkURL('changelo
|
||||
* Warning if using the default MySQL privileged account
|
||||
*/
|
||||
if ($server != 0
|
||||
&& $cfg['Server']['user'] == 'root'
|
||||
&& $cfg['Server']['password'] == '') {
|
||||
&& $cfg['Server']['user'] == 'root'
|
||||
&& $cfg['Server']['password'] == ''
|
||||
) {
|
||||
trigger_error(__('Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user \'root\'.'), E_USER_WARNING);
|
||||
}
|
||||
|
||||
@ -310,8 +313,9 @@ if ($GLOBALS['cfg']['LoginCookieStore'] != 0 && $GLOBALS['cfg']['LoginCookieStor
|
||||
/**
|
||||
* Check if user does not have defined blowfish secret and it is being used.
|
||||
*/
|
||||
if (!empty($_SESSION['auto_blowfish_secret']) &&
|
||||
empty($GLOBALS['cfg']['blowfish_secret'])) {
|
||||
if (! empty($_SESSION['auto_blowfish_secret'])
|
||||
&& empty($GLOBALS['cfg']['blowfish_secret'])
|
||||
) {
|
||||
trigger_error(__('The configuration file now needs a secret passphrase (blowfish_secret).'), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
@ -239,7 +239,8 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
|
||||
$db_tooltip = '';
|
||||
|
||||
if ($GLOBALS['cfg']['ShowTooltip']
|
||||
&& $GLOBALS['cfgRelation']['commwork']) {
|
||||
&& $GLOBALS['cfgRelation']['commwork']
|
||||
) {
|
||||
$_db_tooltip = PMA_getDbComment($GLOBALS['db']);
|
||||
if ($_db_tooltip) {
|
||||
$db_tooltip = $_db_tooltip;
|
||||
@ -348,7 +349,9 @@ function PMA_displayDbList($ext_dblist, $offset, $count)
|
||||
$element_counter++;
|
||||
echo '<li class="dbgroup">';
|
||||
if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
|
||||
|| $db_start == $group || strpos($db_start, $group) === 0) {
|
||||
|| $db_start == $group
|
||||
|| strpos($db_start, $group) === 0
|
||||
) {
|
||||
// display + only if this db(group) is not preselected
|
||||
printf($href_left, $element_counter, PMA_generate_common_url());
|
||||
printf($img_minus, $element_counter);
|
||||
@ -358,7 +361,9 @@ function PMA_displayDbList($ext_dblist, $offset, $count)
|
||||
}
|
||||
echo '</a> ' . $group . "\n";
|
||||
if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
|
||||
|| $db_start == $group || strpos($db_start, $group) === 0) {
|
||||
|| $db_start == $group
|
||||
|| strpos($db_start, $group) === 0
|
||||
) {
|
||||
echo '<ul id="subel' . $element_counter . '">' . "\n";
|
||||
} else {
|
||||
echo '<ul id="subel' . $element_counter . '"'
|
||||
|
||||
@ -18,7 +18,8 @@ require_once 'libraries/sqlparser.lib.php';
|
||||
// MSIE 6 (at least some unpatched versions) has problems loading CSS
|
||||
// when zlib_compression is on
|
||||
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER == '6'
|
||||
&& (ini_get('zlib.output_compression'))) {
|
||||
&& (ini_get('zlib.output_compression'))
|
||||
) {
|
||||
@ini_set('zlib.output_compression', 'Off');
|
||||
}
|
||||
|
||||
|
||||
@ -303,16 +303,19 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
|
||||
?>
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Field_small<?php
|
||||
if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')) {
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')
|
||||
) {
|
||||
echo '_char';
|
||||
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')) {
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
|
||||
) {
|
||||
echo '_int';
|
||||
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')) {
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|
||||
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')
|
||||
) {
|
||||
echo '_date';
|
||||
}
|
||||
?>.png" alt="*" />
|
||||
|
||||
@ -24,7 +24,8 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
|
||||
// relation exists?
|
||||
$existrel_foreign = PMA_getForeigners($db, $T2, '', 'foreign');
|
||||
if (isset($existrel_foreign[$F2])
|
||||
&& isset($existrel_foreign[$F2]['constraint'])) {
|
||||
&& isset($existrel_foreign[$F2]['constraint'])
|
||||
) {
|
||||
PMD_return_new(0, __('Error: relation already exists.'));
|
||||
}
|
||||
// note: in InnoDB, the index does not requires to be on a PRIMARY
|
||||
|
||||
@ -139,24 +139,28 @@ if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') ==
|
||||
// check for ThemeDefault and fontsize
|
||||
$params = array();
|
||||
if (isset($config['ThemeDefault'])
|
||||
&& $_SESSION['PMA_Theme_Manager']->theme->getId() != $config['ThemeDefault']
|
||||
&& $_SESSION['PMA_Theme_Manager']->checkTheme($config['ThemeDefault'])) {
|
||||
&& $_SESSION['PMA_Theme_Manager']->theme->getId() != $config['ThemeDefault']
|
||||
&& $_SESSION['PMA_Theme_Manager']->checkTheme($config['ThemeDefault'])
|
||||
) {
|
||||
$_SESSION['PMA_Theme_Manager']->setActiveTheme($config['ThemeDefault']);
|
||||
$_SESSION['PMA_Theme_Manager']->setThemeCookie();
|
||||
$params['reload_left_frame'] = true;
|
||||
}
|
||||
if (isset($config['fontsize'])
|
||||
&& $config['fontsize'] != $GLOBALS['PMA_Config']->get('fontsize')) {
|
||||
&& $config['fontsize'] != $GLOBALS['PMA_Config']->get('fontsize')
|
||||
) {
|
||||
$params['set_fontsize'] = $config['fontsize'];
|
||||
$params['reload_left_frame'] = true;
|
||||
}
|
||||
if (isset($config['lang'])
|
||||
&& $config['lang'] != $GLOBALS['lang']) {
|
||||
&& $config['lang'] != $GLOBALS['lang']
|
||||
) {
|
||||
$params['lang'] = $config['lang'];
|
||||
$params['reload_left_frame'] = true;
|
||||
}
|
||||
if (isset($config['collation_connection'])
|
||||
&& $config['collation_connection'] != $GLOBALS['collation_connection']) {
|
||||
&& $config['collation_connection'] != $GLOBALS['collation_connection']
|
||||
) {
|
||||
$params['collation_connection'] = $config['collation_connection'];
|
||||
$params['reload_left_frame'] = true;
|
||||
}
|
||||
|
||||
@ -43,7 +43,8 @@ $querydisplay_tabs = array(
|
||||
);
|
||||
|
||||
if (isset($_REQUEST['querydisplay_tab'])
|
||||
&& in_array($_REQUEST['querydisplay_tab'], $querydisplay_tabs)) {
|
||||
&& in_array($_REQUEST['querydisplay_tab'], $querydisplay_tabs)
|
||||
) {
|
||||
$querydisplay_tab = $_REQUEST['querydisplay_tab'];
|
||||
} else {
|
||||
$querydisplay_tab = $GLOBALS['cfg']['QueryWindowDefTab'];
|
||||
@ -169,7 +170,8 @@ PMA_sqlQueryForm($query_to_display, $querydisplay_tab);
|
||||
|
||||
$_sql_history = PMA_getHistory($GLOBALS['cfg']['Server']['user']);
|
||||
if (! empty($_sql_history)
|
||||
&& ($querydisplay_tab == 'history' || $querydisplay_tab == 'full')) {
|
||||
&& ($querydisplay_tab == 'history' || $querydisplay_tab == 'full')
|
||||
) {
|
||||
$tab = $querydisplay_tab != 'full' ? 'sql' : 'full';
|
||||
echo __('SQL history') . ':<br />'
|
||||
. '<ul>';
|
||||
|
||||
@ -59,10 +59,10 @@ if (! isset($cfgRelation['pdf_pages'])) {
|
||||
|
||||
if ($cfgRelation['pdfwork']) {
|
||||
|
||||
/**
|
||||
* User object created for presenting the HTML options
|
||||
* so, user can interact with it and perform export of relations schema
|
||||
*/
|
||||
/**
|
||||
* User object created for presenting the HTML options
|
||||
* so, user can interact with it and perform export of relations schema
|
||||
*/
|
||||
|
||||
include_once 'libraries/schema/User_Schema.class.php';
|
||||
$user_schema = new PMA_User_Schema();
|
||||
@ -103,14 +103,15 @@ if ($cfgRelation['pdfwork']) {
|
||||
$user_schema->showTableDashBoard();
|
||||
|
||||
if (isset($_REQUEST['do'])
|
||||
&& ($_REQUEST['do'] == 'edcoord'
|
||||
|| ($_REQUEST['do']== 'selectpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0)
|
||||
|| ($_REQUEST['do'] == 'createpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0))) {
|
||||
&& ($_REQUEST['do'] == 'edcoord'
|
||||
|| ($_REQUEST['do']== 'selectpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0)
|
||||
|| ($_REQUEST['do'] == 'createpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0))
|
||||
) {
|
||||
|
||||
/**
|
||||
* show Export schema generation options
|
||||
*/
|
||||
$user_schema->displaySchemaGenerationOptions();
|
||||
/**
|
||||
* show Export schema generation options
|
||||
*/
|
||||
$user_schema->displaySchemaGenerationOptions();
|
||||
|
||||
if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
|
||||
?>
|
||||
@ -120,7 +121,7 @@ if ($cfgRelation['pdfwork']) {
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
} // end if
|
||||
} // end if ($cfgRelation['pdfwork'])
|
||||
|
||||
|
||||
@ -91,7 +91,8 @@ if ((isset($_REQUEST['drop_selected_dbs']) || isset($_REQUEST['query_type']))
|
||||
$submit_mult = 'drop_db';
|
||||
$err_url = 'server_databases.php?' . PMA_generate_common_url();
|
||||
if (isset($_REQUEST['selected_dbs'])
|
||||
&& !isset($_REQUEST['is_js_confirmed'])) {
|
||||
&& !isset($_REQUEST['is_js_confirmed'])
|
||||
) {
|
||||
$selected_db = $_REQUEST['selected_dbs'];
|
||||
}
|
||||
if (isset($_REQUEST['is_js_confirmed'])) {
|
||||
|
||||
@ -10,7 +10,8 @@ $GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
|
||||
header('Expires: ' . date(DATE_RFC1123)); // rfc2616 - Section 14.21
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
|
||||
if (isset($_SERVER['HTTP_USER_AGENT'])
|
||||
&& stristr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
|
||||
&& stristr($_SERVER['HTTP_USER_AGENT'], 'MSIE')
|
||||
) {
|
||||
|
||||
/* FIXME: Why is this special case for IE needed? */
|
||||
header('Pragma: public');
|
||||
|
||||
@ -54,7 +54,8 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
$field_fulltext = array();
|
||||
for ($i = 0; $i < $field_cnt; ++$i) {
|
||||
if (isset($_REQUEST['field_key'][$i])
|
||||
&& strlen($_REQUEST['field_name'][$i])) {
|
||||
&& strlen($_REQUEST['field_name'][$i])
|
||||
) {
|
||||
if ($_REQUEST['field_key'][$i] == 'primary_' . $i) {
|
||||
$field_primary[] = $i;
|
||||
}
|
||||
|
||||
@ -134,8 +134,9 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
// update mime types
|
||||
if (isset($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']) {
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']
|
||||
) {
|
||||
foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_REQUEST['field_name'][$fieldindex])
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex])
|
||||
|
||||
@ -210,11 +210,13 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
// Update comment table for mime types [MIME]
|
||||
if (isset($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']) {
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']
|
||||
) {
|
||||
foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_REQUEST['field_name'][$fieldindex])
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex])) {
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex])
|
||||
) {
|
||||
PMA_setMIME(
|
||||
$db, $table, $_REQUEST['field_name'][$fieldindex], $mimetype,
|
||||
$_REQUEST['field_transformation'][$fieldindex],
|
||||
|
||||
@ -55,7 +55,8 @@ if (! empty($sql_query)) {
|
||||
$wheres = array();
|
||||
|
||||
if (isset($where_clause) && is_array($where_clause)
|
||||
&& count($where_clause) > 0) {
|
||||
&& count($where_clause) > 0
|
||||
) {
|
||||
$wheres[] = '(' . implode(') OR (', $where_clause) . ')';
|
||||
}
|
||||
|
||||
|
||||
@ -97,11 +97,13 @@ if (isset($_REQUEST['submitoptions'])) {
|
||||
}
|
||||
}
|
||||
if (isset($_REQUEST['comment'])
|
||||
&& urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']) {
|
||||
&& urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']
|
||||
) {
|
||||
$table_alters[] = 'COMMENT = \'' . PMA_sqlAddSlashes($_REQUEST['comment']) . '\'';
|
||||
}
|
||||
if (! empty($_REQUEST['new_tbl_storage_engine'])
|
||||
&& strtolower($_REQUEST['new_tbl_storage_engine']) !== strtolower($tbl_storage_engine)) {
|
||||
&& strtolower($_REQUEST['new_tbl_storage_engine']) !== strtolower($tbl_storage_engine)
|
||||
) {
|
||||
$table_alters[] = 'ENGINE = ' . $_REQUEST['new_tbl_storage_engine'];
|
||||
$tbl_storage_engine = $_REQUEST['new_tbl_storage_engine'];
|
||||
// reset the globals for the new engine
|
||||
@ -113,51 +115,59 @@ if (isset($_REQUEST['submitoptions'])) {
|
||||
}
|
||||
|
||||
if (! empty($_REQUEST['tbl_collation'])
|
||||
&& $_REQUEST['tbl_collation'] !== $tbl_collation) {
|
||||
&& $_REQUEST['tbl_collation'] !== $tbl_collation
|
||||
) {
|
||||
$table_alters[] = 'DEFAULT ' . PMA_generateCharsetQueryPart($_REQUEST['tbl_collation']);
|
||||
}
|
||||
|
||||
if (($is_myisam_or_aria || $is_isam)
|
||||
&& isset($_REQUEST['new_pack_keys'])
|
||||
&& $_REQUEST['new_pack_keys'] != (string)$pack_keys) {
|
||||
&& isset($_REQUEST['new_pack_keys'])
|
||||
&& $_REQUEST['new_pack_keys'] != (string)$pack_keys
|
||||
) {
|
||||
$table_alters[] = 'pack_keys = ' . $_REQUEST['new_pack_keys'];
|
||||
}
|
||||
|
||||
$checksum = empty($checksum) ? '0' : '1';
|
||||
$_REQUEST['new_checksum'] = empty($_REQUEST['new_checksum']) ? '0' : '1';
|
||||
if ($is_myisam_or_aria
|
||||
&& $_REQUEST['new_checksum'] !== $checksum) {
|
||||
&& $_REQUEST['new_checksum'] !== $checksum
|
||||
) {
|
||||
$table_alters[] = 'checksum = ' . $_REQUEST['new_checksum'];
|
||||
}
|
||||
|
||||
$_REQUEST['new_transactional'] = empty($_REQUEST['new_transactional']) ? '0' : '1';
|
||||
if ($is_aria
|
||||
&& $_REQUEST['new_transactional'] !== $transactional) {
|
||||
&& $_REQUEST['new_transactional'] !== $transactional
|
||||
) {
|
||||
$table_alters[] = 'TRANSACTIONAL = ' . $_REQUEST['new_transactional'];
|
||||
}
|
||||
|
||||
$_REQUEST['new_page_checksum'] = empty($_REQUEST['new_page_checksum']) ? '0' : '1';
|
||||
if ($is_aria
|
||||
&& $_REQUEST['new_page_checksum'] !== $page_checksum) {
|
||||
&& $_REQUEST['new_page_checksum'] !== $page_checksum
|
||||
) {
|
||||
$table_alters[] = 'PAGE_CHECKSUM = ' . $_REQUEST['new_page_checksum'];
|
||||
}
|
||||
|
||||
$delay_key_write = empty($delay_key_write) ? '0' : '1';
|
||||
$_REQUEST['new_delay_key_write'] = empty($_REQUEST['new_delay_key_write']) ? '0' : '1';
|
||||
if ($is_myisam_or_aria
|
||||
&& $_REQUEST['new_delay_key_write'] !== $delay_key_write) {
|
||||
&& $_REQUEST['new_delay_key_write'] !== $delay_key_write
|
||||
) {
|
||||
$table_alters[] = 'delay_key_write = ' . $_REQUEST['new_delay_key_write'];
|
||||
}
|
||||
|
||||
if (($is_myisam_or_aria || $is_innodb || $is_pbxt)
|
||||
&& ! empty($_REQUEST['new_auto_increment'])
|
||||
&& (! isset($auto_increment) || $_REQUEST['new_auto_increment'] !== $auto_increment)) {
|
||||
&& ! empty($_REQUEST['new_auto_increment'])
|
||||
&& (! isset($auto_increment) || $_REQUEST['new_auto_increment'] !== $auto_increment)
|
||||
) {
|
||||
$table_alters[] = 'auto_increment = ' . PMA_sqlAddSlashes($_REQUEST['new_auto_increment']);
|
||||
}
|
||||
|
||||
if (($is_myisam_or_aria || $is_innodb || $is_pbxt)
|
||||
&& ! empty($_REQUEST['new_row_format'])
|
||||
&& (! isset($row_format) || strtolower($_REQUEST['new_row_format']) !== strtolower($row_format))) {
|
||||
&& ! empty($_REQUEST['new_row_format'])
|
||||
&& (! isset($row_format) || strtolower($_REQUEST['new_row_format']) !== strtolower($row_format))
|
||||
) {
|
||||
$table_alters[] = 'ROW_FORMAT = ' . PMA_sqlAddSlashes($_REQUEST['new_row_format']);
|
||||
}
|
||||
|
||||
@ -452,7 +462,8 @@ if ($is_aria) {
|
||||
} // end if (ARIA)
|
||||
|
||||
if (isset($auto_increment) && strlen($auto_increment) > 0
|
||||
&& ($is_myisam_or_aria || $is_innodb || $is_pbxt)) {
|
||||
&& ($is_myisam_or_aria || $is_innodb || $is_pbxt)
|
||||
) {
|
||||
?>
|
||||
<tr><td><label for="auto_increment_opt">AUTO_INCREMENT</label></td>
|
||||
<td><input type="text" name="new_auto_increment" id="auto_increment_opt"
|
||||
@ -570,7 +581,8 @@ if (isset($possible_row_formats[$tbl_storage_engine])) {
|
||||
<?php
|
||||
} // endif
|
||||
if (isset($_COOKIE['pma_switch_to_new'])
|
||||
&& $_COOKIE['pma_switch_to_new'] == 'true') {
|
||||
&& $_COOKIE['pma_switch_to_new'] == 'true'
|
||||
) {
|
||||
$pma_switch_to_new = 'true';
|
||||
}
|
||||
?>
|
||||
|
||||
@ -16,7 +16,8 @@ require_once 'libraries/mysql_charsets.lib.php';
|
||||
* No rows were selected => show again the query and tell that user.
|
||||
*/
|
||||
if (! PMA_isValid($_REQUEST['rows_to_delete'], 'array')
|
||||
&& ! isset($_REQUEST['mult_btn'])) {
|
||||
&& ! isset($_REQUEST['mult_btn'])
|
||||
) {
|
||||
$disp_message = __('No rows selected');
|
||||
$disp_query = '';
|
||||
include 'sql.php';
|
||||
|
||||
@ -426,7 +426,8 @@ foreach ($fields as $row) {
|
||||
<?php
|
||||
if (! empty($tbl_storage_engine) && ($tbl_storage_engine == 'MYISAM' || $tbl_storage_engine == 'ARIA' || $tbl_storage_engine == 'MARIA' || ($tbl_storage_engine == 'INNODB' && PMA_MYSQL_INT_VERSION >= 50604))
|
||||
// FULLTEXT is possible on TEXT, CHAR and VARCHAR
|
||||
&& (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char'))) {
|
||||
&& (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char'))
|
||||
) {
|
||||
echo "\n";
|
||||
?>
|
||||
<td class="fulltext replaced_by_more center nowrap">
|
||||
|
||||
@ -67,8 +67,10 @@ if (isset($_REQUEST['report_export'])) {
|
||||
foreach ( $data as $entry ) {
|
||||
$timestamp = strtotime($entry['date']);
|
||||
|
||||
if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to &&
|
||||
( in_array('*', $filter_users) || in_array($entry['username'], $filter_users) ) ) {
|
||||
if ($timestamp >= $filter_ts_from
|
||||
&& $timestamp <= $filter_ts_to
|
||||
&& (in_array('*', $filter_users) || in_array($entry['username'], $filter_users))
|
||||
) {
|
||||
$tmp_entries[] = array( 'id' => $id,
|
||||
'timestamp' => $timestamp,
|
||||
'username' => $entry['username'],
|
||||
@ -493,8 +495,10 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
|
||||
}
|
||||
$timestamp = strtotime($entry['date']);
|
||||
|
||||
if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to &&
|
||||
( in_array('*', $filter_users) || in_array($entry['username'], $filter_users) ) ) {
|
||||
if ($timestamp >= $filter_ts_from
|
||||
&& $timestamp <= $filter_ts_to
|
||||
&& (in_array('*', $filter_users) || in_array($entry['username'], $filter_users))
|
||||
) {
|
||||
?>
|
||||
<tr class="noclick <?php echo $style; ?>">
|
||||
<td><small><?php echo $i;?></small></td>
|
||||
@ -549,8 +553,10 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
|
||||
}
|
||||
$timestamp = strtotime($entry['date']);
|
||||
|
||||
if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to &&
|
||||
( in_array('*', $filter_users) || in_array($entry['username'], $filter_users) ) ) {
|
||||
if ($timestamp >= $filter_ts_from
|
||||
&& $timestamp <= $filter_ts_to
|
||||
&& (in_array('*', $filter_users) || in_array($entry['username'], $filter_users))
|
||||
) {
|
||||
?>
|
||||
<tr class="noclick <?php echo $style; ?>">
|
||||
<td><small><?php echo $i; ?></small></td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user