r68512 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68511‎ | r68512 | r68513 >
Date:12:19, 24 June 2010
Author:platonides
Status:ok
Tags:
Comment:
Follow up r66267.
The length of strings is given by strlen, not count.

It's strange that this worked before. Although for big files it gave a String size overflow fatal error.
Modified paths:
  • /trunk/phase3/includes/ImportXMLReader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImportXMLReader.php
@@ -660,17 +660,17 @@
661661 $leave = false;
662662
663663 while ( !$leave && !$this->mSource->atEnd() &&
664 - count($this->mBuffer) < $count ) {
 664+ strlen($this->mBuffer) < $count ) {
665665 $read = $this->mSource->readChunk();
666666
667 - if ( !count($read) ) {
 667+ if ( !strlen($read) ) {
668668 $leave = true;
669669 }
670670
671671 $this->mBuffer .= $read;
672672 }
673673
674 - if ( count($this->mBuffer) ) {
 674+ if ( strlen($this->mBuffer) ) {
675675 $return = substr( $this->mBuffer, 0, $count );
676676 $this->mBuffer = substr( $this->mBuffer, $count );
677677 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66267Rewrite of XML Dump Processing:...werdna13:28, 12 May 2010

Status & tagging log