diff --git a/inc/functions_sql.php b/inc/functions_sql.php index d9f4052..b74693a 100644 --- a/inc/functions_sql.php +++ b/inc/functions_sql.php @@ -18,7 +18,7 @@ function ReadSQL() fclose($fp); @chmod($sf,0777); } - if (count($SQL_ARRAY) == 0 && filesize($sf) > 0) + if ((!is_array($SQL_ARRAY) || count($SQL_ARRAY) == 0) && filesize($sf) > 0) { $SQL_ARRAY=file($sf); } @@ -63,7 +63,7 @@ function SQL_ComboBox() { global $SQL_ARRAY,$tablename,$nl; $s=''; - if (count($SQL_ARRAY) > 0) + if (is_array($SQL_ARRAY) && count($SQL_ARRAY) > 0) { $s=$nl . $nl . ''; diff --git a/inc/sqlbrowser/sql_commands.php b/inc/sqlbrowser/sql_commands.php index e6bc9a9..42537b2 100644 --- a/inc/sqlbrowser/sql_commands.php +++ b/inc/sqlbrowser/sql_commands.php @@ -7,12 +7,12 @@ function nl2null($string) return trim(str_replace($search,$replace,$string)); } //SQL-Strings -echo $aus.='

' . $lang['L_SQL_BEFEHLE'] . ' (' . count($SQL_ARRAY) . ')

'; +echo $aus.='

' . $lang['L_SQL_BEFEHLE'] . ' (' . (is_array($SQL_ARRAY)? count($SQL_ARRAY) : 0) . ')

'; echo '' . $lang['L_SQL_BEFEHLNEU'] . '

'; if (isset($_POST['sqlnewupdate'])) { - $ind=count($SQL_ARRAY); - if (count($SQL_ARRAY) > 0) array_push($SQL_ARRAY,$_POST['sqlname' . $ind] . "|" . $_POST['sqlstring' . $ind]); + $ind=(is_array($SQL_ARRAY))? count($SQL_ARRAY) : 0; + if ($ind > 0) array_push($SQL_ARRAY,$_POST['sqlname' . $ind] . "|" . $_POST['sqlstring' . $ind]); else $SQL_ARRAY[0]=htmlspecialchars($_POST['sqlname0'],ENT_COMPAT ,'UTF-8') . '|' . $_POST['sqlstring0']; WriteSQL(); echo '

' . $lang['L_SQL_BEFEHLSAVED1'] . ' \'' . $_POST['sqlname' . $ind] . '\' ' . $lang['L_SQL_BEFEHLSAVED2'] . '

'; @@ -24,7 +24,7 @@ echo '
'; echo ''; $i=0; -if (count($SQL_ARRAY) > 0) +if (is_array($SQL_ARRAY) && count($SQL_ARRAY) > 0) { for ($i=0; $i < count($SQL_ARRAY); $i++) { diff --git a/restore.php b/restore.php index c34f9d4..4745649 100644 --- a/restore.php +++ b/restore.php @@ -120,7 +120,7 @@ if ($restore['filehandle']) { @mysqli_query($config['dbconnection'], '/*!40000 ALTER TABLE `'.$restore['actual_table'].'` DISABLE KEYS */;'); } - elseif (sizeof($restore['tables_to_restore'])==0&&($restore['actual_table']>''&&$restore['actual_table']!='unbekannt')) @mysqli_query($config['dbconnection'], '/*!40000 ALTER TABLE `'.$restore['actual_table'].'` DISABLE KEYS */;'); + elseif ((!is_array($restore['tables_to_restore'])||sizeof($restore['tables_to_restore'])==0)&&($restore['actual_table']>''&&$restore['actual_table']!='unbekannt')) @mysqli_query($config['dbconnection'], '/*!40000 ALTER TABLE `'.$restore['actual_table'].'` DISABLE KEYS */;'); WHILE (($a<$restore['anzahl_zeilen'])&&(!$restore['fileEOF'])&&($dauer<$restore['max_zeit'])&&!$restore['EOB']) {
#' . $lang['L_NAME'] . 'SQL' . $lang['L_COMMAND'] . '