From: Brion Vibber Date: Sun, 16 Oct 2005 23:53:29 +0000 (+0000) Subject: Don't explode in dump text prefetch when we fall off the end of the file :D X-Git-Tag: 1.6.0~1402 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=75c72ffef3663223ec023196449bd30020455a9c;p=lhc%2Fweb%2Fwiklou.git Don't explode in dump text prefetch when we fall off the end of the file :D --- diff --git a/maintenance/backupPrefetch.inc b/maintenance/backupPrefetch.inc index ddb0656e0a..759220da04 100644 --- a/maintenance/backupPrefetch.inc +++ b/maintenance/backupPrefetch.inc @@ -92,6 +92,9 @@ class BaseDump { * @access private */ function skipTo( $name ) { + if( $this->atEnd ) { + return false; + } while( $this->reader->read() ) { if( $this->reader->nodeType == XMLREADER_ELEMENT && $this->reader->name == $name ) { @@ -109,6 +112,9 @@ class BaseDump { * @access private */ function nodeContents() { + if( $this->atEnd ) { + return false; + } if( $this->reader->isEmptyElement ) { return ""; } @@ -132,7 +138,6 @@ class BaseDump { */ function close() { $this->reader->close(); - $this->reader = null; $this->atEnd = true; return false; }