uninitialized variable

This commit is contained in:
Sebastian Mendel
2005-11-23 17:34:44 +00:00
parent 8f1bb56896
commit b755b20bde
2 changed files with 13 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ $Source$
* themes.php, css/phpmyadmin.css.php: * themes.php, css/phpmyadmin.css.php:
- moved styles into css - moved styles into css
- no need for javascript - no need for javascript
* relation.lib.php: uninitialized variable
2005-11-23 Michal Čihař <michal@cihar.com> 2005-11-23 Michal Čihař <michal@cihar.com>
* config.default.php, libraries/import/csv.php, libraries/import/ldi.php: * config.default.php, libraries/import/csv.php, libraries/import/ldi.php:

View File

@@ -44,7 +44,7 @@
} else { } else {
return FALSE; return FALSE;
} }
} // end of the "PMA_query_as_cu()" function } // end of the "PMA_query_as_cu()" function
/** /**
@@ -324,7 +324,7 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') {
// The parser looks for a CONSTRAINT clause just before // The parser looks for a CONSTRAINT clause just before
// the FOREIGN KEY clause. It finds it (as output from // the FOREIGN KEY clause. It finds it (as output from
// SHOW CREATE TABLE) in MySQL 4.0.13, but not in older // SHOW CREATE TABLE) in MySQL 4.0.13, but not in older
// versions like 3.23.58. // versions like 3.23.58.
// In those cases, the FOREIGN KEY parsing will put numbers // In those cases, the FOREIGN KEY parsing will put numbers
// like -1, 0, 1... instead of the constraint number. // like -1, 0, 1... instead of the constraint number.
@@ -496,7 +496,7 @@ function PMA_getComments($db, $table = '') {
if (strlen($row['comment']) > 0) { if (strlen($row['comment']) > 0) {
$comment[$col] = $row['comment']; $comment[$col] = $row['comment'];
// if this version supports native comments and this function // if this version supports native comments and this function
// was called with a table parameter // was called with a table parameter
if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($table)) { if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($table)) {
// if native comment found, use it instead of pmadb // if native comment found, use it instead of pmadb
if (!empty($native_comment[$col])) { if (!empty($native_comment[$col])) {
@@ -570,8 +570,8 @@ function PMA_setComment($db, $table, $col, $comment, $removekey = '', $mode='aut
return TRUE; return TRUE;
} }
// $mode == 'pmadb' section: // $mode == 'pmadb' section:
$cols = array( $cols = array(
'db_name' => 'db_name ', 'db_name' => 'db_name ',
'table_name' => 'table_name ', 'table_name' => 'table_name ',
@@ -734,11 +734,11 @@ function PMA_purgeHistory($username) {
/** /**
* Prepares the dropdown for one mode * Prepares the dropdown for one mode
* *
* @param array the keys and values for foreigns * @param array the keys and values for foreigns
* @param string the current data of the dropdown * @param string the current data of the dropdown
* @param string the needed mode * @param string the needed mode
* *
* @global array global phpMyAdmin configuration * @global array global phpMyAdmin configuration
* *
@@ -750,7 +750,7 @@ function PMA_foreignDropdownBuild($foreign, $data, $mode) {
global $cfg; global $cfg;
$reloptions = array(); $reloptions = array();
foreach ($foreign as $key => $value) { foreach ($foreign as $key => $value) {
if (PMA_strlen($value) <= $cfg['LimitChars']) { if (PMA_strlen($value) <= $cfg['LimitChars']) {
@@ -797,6 +797,8 @@ function PMA_foreignDropdownBuild($foreign, $data, $mode) {
function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $max) { function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $max) {
global $cfg; global $cfg;
$foreign = array();
// collect the data // collect the data
foreach ($disp as $relrow) { foreach ($disp as $relrow) {
$key = $relrow[$foreign_field]; $key = $relrow[$foreign_field];
@@ -817,7 +819,7 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
// master array for dropdowns // master array for dropdowns
$reloptions = array('content-id' => array(), 'id-content' => array()); $reloptions = array('content-id' => array(), 'id-content' => array());
// sort for id-content // sort for id-content
if ($cfg['NaturalOrder']) { if ($cfg['NaturalOrder']) {
uksort($foreign, 'strnatcasecmp'); uksort($foreign, 'strnatcasecmp');
} else { } else {
@@ -838,7 +840,7 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
$reloptions['content-id'] = PMA_foreignDropdownBuild($foreign, $data, 'content-id'); $reloptions['content-id'] = PMA_foreignDropdownBuild($foreign, $data, 'content-id');
// put the dropdown sections in correct order // put the dropdown sections in correct order
$c = count($cfg['ForeignKeyDropdownOrder']); $c = count($cfg['ForeignKeyDropdownOrder']);
if($c == 2) { if($c == 2) {