diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 87d9953ad..5d63ca166 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -81,26 +81,26 @@ function PMA_securePath($path)
*/
function PMA_getDbList()
{
- if ( empty( $GLOBALS['dblist'] ) ) {
+ if (empty($GLOBALS['dblist'])) {
PMA_availableDatabases();
}
$dblist = $GLOBALS['dblist'];
$dbgroups = array();
$parts = array();
- foreach ( $dblist as $key => $db ) {
+ foreach ($dblist as $key => $db) {
// garvin: Get comments from PMA comments table
$db_tooltip = '';
- if ( $GLOBALS['cfg']['ShowTooltip']
- && $GLOBALS['cfgRelation']['commwork'] ) {
+ if ($GLOBALS['cfg']['ShowTooltip']
+ && $GLOBALS['cfgRelation']['commwork']) {
$_db_tooltip = PMA_getComments($db);
- if ( is_array($_db_tooltip) ) {
+ if (is_array($_db_tooltip)) {
$db_tooltip = implode(' ', $_db_tooltip);
}
}
- if ( $GLOBALS['cfg']['LeftFrameDBTree']
+ if ($GLOBALS['cfg']['LeftFrameDBTree']
&& $GLOBALS['cfg']['LeftFrameDBSeparator']
- && strstr($db, $GLOBALS['cfg']['LeftFrameDBSeparator']) )
+ && strstr($db, $GLOBALS['cfg']['LeftFrameDBSeparator']))
{
$pos = strrpos($db, $GLOBALS['cfg']['LeftFrameDBSeparator']);
$group = substr($db, 0, $pos);
@@ -111,7 +111,7 @@ function PMA_getDbList()
}
$disp_name = $db;
- if ( $db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB'] ) {
+ if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
$disp_name = $db_tooltip;
$disp_name_cut = $db_tooltip;
$db_tooltip = $db;
@@ -123,8 +123,8 @@ function PMA_getDbList()
'disp_name' => $disp_name,
'comment' => $db_tooltip,
'num_tables' => PMA_getTableCount($db),
- );
- } // end foreach ( $dblist as $db )
+ );
+ } // end foreach ($dblist as $db)
return $dbgroups;
}
@@ -143,8 +143,8 @@ function PMA_getHtmlSelectDb($selected = '')
.' onchange="window.parent.openDb(this.value);">' . "\n"
.''
."\n";
- foreach ( $dblist as $group => $dbs ) {
- if ( count($dbs) > 1 ) {
+ foreach ($dblist as $group => $dbs) {
+ if (count($dbs) > 1) {
$return .= '' . "\n";
}
}
@@ -182,7 +182,7 @@ function PMA_getTableCount($db)
$tables = PMA_DBI_try_query(
'SHOW TABLES FROM ' . PMA_backquote($db) . ';',
null, PMA_DBI_QUERY_STORE);
- if ( $tables ) {
+ if ($tables) {
$num_tables = PMA_DBI_num_rows($tables);
PMA_DBI_free_result($tables);
} else {
@@ -232,7 +232,7 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $userlink,
// Access to "mysql" db allowed and dblist still empty -> gets the
// usable db list
- if ( ! $dblist_cnt && ($rs && @PMA_DBI_num_rows($rs)) ) {
+ if (!$dblist_cnt && ($rs && @PMA_DBI_num_rows($rs))) {
$row = PMA_DBI_fetch_assoc($rs);
PMA_DBI_free_result($rs);
// Correction uva 19991215
@@ -313,7 +313,7 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $userlink,
$rs = PMA_DBI_try_query($local_query, $controllink);
if ($rs && @PMA_DBI_num_rows($rs)) {
while ($row = PMA_DBI_fetch_assoc($rs)) {
- if ( ! in_array($row['Db'], $dblist) ) {
+ if (!in_array($row['Db'], $dblist)) {
$dblist[] = $row['Db'];
}
} // end while
@@ -333,7 +333,7 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $userlink,
*/
function get_real_size($size = 0)
{
- if ( ! $size ) {
+ if (!$size) {
return 0;
}
$scan['MB'] = 1048576;
@@ -345,9 +345,9 @@ function get_real_size($size = 0)
$scan['K'] = 1024;
$scan['k'] = 1024;
- while ( list( $key ) = each($scan) ) {
- if ( ( strlen($size) > strlen($key) )
- && ( substr($size, strlen($size) - strlen($key)) == $key ) ) {
+ while (list($key) = each($scan)) {
+ if ((strlen($size) > strlen($key))
+ && (substr($size, strlen($size) - strlen($key)) == $key)) {
$size = substr($size, 0, strlen($size) - strlen($key)) * $scan[$key];
break;
}
@@ -378,14 +378,14 @@ function PMA_dl($module)
{
static $dl_allowed = null;
- if ( extension_loaded($module) ) {
+ if (extension_loaded($module)) {
return true;
}
- if ( null === $dl_allowed ) {
- if ( ! @ini_get('safe_mode')
+ if (null === $dl_allowed) {
+ if (!@ini_get('safe_mode')
&& @ini_get('enable_dl')
- && @function_exists('dl') ) {
+ && @function_exists('dl')) {
ob_start();
phpinfo(INFO_GENERAL); /* Only general info */
$a = strip_tags(ob_get_contents());
@@ -404,11 +404,11 @@ function PMA_dl($module)
}
}
- if ( ! $dl_allowed ) {
+ if (!$dl_allowed) {
return false;
}
- if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ) {
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$module_file = 'php_' . $module . '.dll';
} else {
$module_file = $module . '.so';
@@ -436,7 +436,7 @@ function PMA_dl($module)
*/
function PMA_array_merge_recursive()
{
- switch( func_num_args() ) {
+ switch(func_num_args()) {
case 0 :
return false;
break;
@@ -445,11 +445,11 @@ function PMA_array_merge_recursive()
break;
case 2 :
$args = func_get_args();
- if ( ! is_array($args[0]) || ! is_array($args[1]) ) {
+ if (!is_array($args[0]) || !is_array($args[1])) {
return $args[1];
}
- foreach ( $args[1] AS $key2 => $value2 ) {
- if ( isset( $args[0][$key2] ) ) {
+ foreach ($args[1] AS $key2 => $value2) {
+ if (isset($args[0][$key2])) {
$args[0][$key2] = PMA_array_merge_recursive($args[0][$key2],
$value2);
} else {
@@ -479,7 +479,7 @@ require_once './libraries/Config.class.php';
-if ( ! defined('PMA_MINIMUM_COMMON') ) {
+if (!defined('PMA_MINIMUM_COMMON')) {
/**
* Displays the maximum size for an upload
*
@@ -682,7 +682,7 @@ if ( ! defined('PMA_MINIMUM_COMMON') ) {
default:
if (empty($link)) $link = 'index';
$mysql = '5.0';
- if ( defined('PMA_MYSQL_INT_VERSION')) {
+ if (defined('PMA_MYSQL_INT_VERSION')) {
if (PMA_MYSQL_INT_VERSION < 50000) {
$mysql = '4.1';
} elseif (PMA_MYSQL_INT_VERSION >= 50100) {
@@ -695,7 +695,7 @@ if ( ! defined('PMA_MINIMUM_COMMON') ) {
break;
}
- if ( $big_icon ) {
+ if ($big_icon) {
return '';
} elseif ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '
';
@@ -846,17 +846,17 @@ if ( ! defined('PMA_MINIMUM_COMMON') ) {
$sql = '
SELECT *
FROM ' . PMA_backquote($error_table) . '
- WHERE CONCAT_WS( "-", ' . implode(', ', $error_fields) . ' )
+ WHERE CONCAT_WS("-", ' . implode(', ', $error_fields) . ')
= "' . PMA_sqlAddslashes($duplicate_value) . '"
ORDER BY ' . implode(', ', $error_fields);
- unset( $error_table, $error_fields, $duplicate_value );
+ unset($error_table, $error_fields, $duplicate_value);
echo '