diff --git a/ChangeLog b/ChangeLog index 8051c80ae..08502a35c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -14,10 +14,13 @@ $Source$ * lang/chinese_big5: Updated, thanks to Siu Sun (siusun). * lang/portuguese: Updated, thanks to António Raposo (cfmsoft). * lang/spanish: Updated, thanks to Daniel Hinostroza (hinostroza). - + 2003-11-19 Alexander M. Turek - * libraries/grab_globals.lib.php3: Do not use $HTTP_*_VARS arrays anymore. + * libraries/grab_globals.lib.php: Do not use $HTTP_*_VARS arrays anymore. * Documentation.html: Modified requirements. + * server_collations.php: Replaced obsolete "while (list() = each())" calls + by foreach loops. + * server_privileges.php: Dropped some MySQL 3.21 / php 3 compatibility code. 2003-11-18 Alexander M. Turek * libraries/common.lib.php: Recognizing new 2.x config.inc.php revisions. diff --git a/server_collations.php b/server_collations.php index fe4a7afda..1084c28dd 100644 --- a/server_collations.php +++ b/server_collations.php @@ -60,7 +60,8 @@ reset($mysql_collations); $i = 0; $table_row_count = count($mysql_charsets) + $mysql_collations_count; -while (list(, $current_charset) = each($mysql_charsets)) { +//while (list(, $current_charset) = each($mysql_charsets)) { +foreach ($mysql_charsets as $current_charset) { if ($i > $table_row_count / 2) { $i = 0; echo ' ' . "\n" @@ -84,8 +85,9 @@ while (list(, $current_charset) = each($mysql_charsets)) { . ' ' . "\n" . ' ' . "\n"; $useBgcolorOne = TRUE; - reset($mysql_collations[$current_charset]); - while (list(, $current_collation) = each($mysql_collations[$current_charset])) { +// reset($mysql_collations[$current_charset]); +// while (list(, $current_collation) = each($mysql_collations[$current_charset])) { + foreach ($mysql_collations[$current_charset] as $current_collation) { $i++; echo ' ' . "\n" . ' ' . "\n" diff --git a/server_privileges.php b/server_privileges.php index eb82182df..9b66cd350 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -82,7 +82,8 @@ function PMA_extractPrivInfo($row = '', $enableHTML = FALSE) $av_grants = explode ('\',\'' , substr($row1['Type'], 5, strlen($row1['Type']) - 7)); unset($row1); $users_grants = explode(',', $row['Table_priv']); - while (list(, $current_grant) = each($av_grants)) { +// while (list(, $current_grant) = each($av_grants)) { + foreach ($av_grants as $current_grant) { $row[$current_grant . '_priv'] = in_array($current_grant, $users_grants) ? 'Y' : 'N'; } unset($current_grant); @@ -91,7 +92,8 @@ function PMA_extractPrivInfo($row = '', $enableHTML = FALSE) } $privs = array(); $allPrivileges = TRUE; - while (list(, $current_grant) = each($grants)) { +// while (list(, $current_grant) = each($grants)) { + foreach ($grants as $current_grant) { if ((!empty($row) && isset($row[$current_grant[0]])) || (empty($row) && isset($GLOBALS[$current_grant[0]]))) { if ((!empty($row) && $row[$current_grant[0]] == 'Y') || (empty($row) && ($GLOBALS[$current_grant[0]] == 'Y' || (is_array($GLOBALS[$current_grant[0]]) && count($GLOBALS[$current_grant[0]]) == $GLOBALS['column_count'] && empty($GLOBALS[$current_grant[0] . '_none']))))) { if ($enableHTML) { @@ -197,7 +199,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = $av_grants = explode ('\',\'' , substr($row1['Type'], strpos($row1['Type'], '(') + 2, strpos($row1['Type'], ')') - strpos($row1['Type'], '(') - 3)); unset($row1); $users_grants = explode(',', $row['Table_priv']); - while (list(, $current_grant) = each($av_grants)) { +// while (list(, $current_grant) = each($av_grants)) { + foreach ($av_grants as $current_grant) { $row[$current_grant . '_priv'] = in_array($current_grant, $users_grants) ? 'Y' : 'N'; } unset($row['Table_priv']); @@ -224,7 +227,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query); while ($row1 = PMA_mysql_fetch_row($res)) { $row1[1] = explode(',', $row1[1]); - while (list(, $current) = each($row1[1])) { +// while (list(, $current) = each($row1[1])) { + foreach ($row1[1] as $current) { $columns[$row1[0]][$current] = TRUE; } } @@ -257,7 +261,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = $rowspan = count($row) - 5; echo $spaces . ' ' . "\n" . $spaces . ' ' . "\n"; - reset($columns); - while (list($current_column, $current_column_privileges) = each($columns)) { +// reset($columns); +// while (list($current_column, $current_column_privileges) = each($columns)) { + foreach ($columns as $current_column => $current_column_privileges) { echo $spaces . '