patch for illegal index

This commit is contained in:
Marc Delisle
2001-07-03 19:52:00 +00:00
parent d7ce13ea7f
commit 623019a2d4
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-07-03 Marc Delisle <lem9@users.sourceforge.net>
* lib.inc.php3: patch from Chee Wai for illegal index
2001-07-03 Steve Alberty <alberty@neptunlabs.de> 2001-07-03 Steve Alberty <alberty@neptunlabs.de>
* tbl_properties.php3: fix minor bug under PHP3 with space usage display * tbl_properties.php3: fix minor bug under PHP3 with space usage display

View File

@@ -819,7 +819,12 @@ function split_sql_file($sql, $delimiter) {
function remove_remarks($sql) { function remove_remarks($sql) {
$i = 0; $i = 0;
while ($i < strlen($sql)) { while ($i < strlen($sql)) {
if ($sql[$i] == "#" and ($sql[$i-1] == "\n" or $i==0)) { // patch from Chee Wai
// (otherwise, if $i==0 and $sql[$i] == "#", the original order
// in the second part of the AND bit will fail with illegal index)
// if ($sql[$i] == "#" and ($sql[$i-1] == "\n" or $i==0)) {
if ($sql[$i] == "#" and ($i==0 or $sql[$i-1] == "\n")) {
$j=1; $j=1;
while ($sql[$i+$j] != "\n") { while ($sql[$i+$j] != "\n") {
$j++; $j++;