Follow up r66267.
authorPlatonides <platonides@users.mediawiki.org>
Thu, 24 Jun 2010 12:19:42 +0000 (12:19 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Thu, 24 Jun 2010 12:19:42 +0000 (12:19 +0000)
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.

includes/ImportXMLReader.php

index d445a28..74183f3 100644 (file)
@@ -660,17 +660,17 @@ class UploadSourceAdapter {
                $leave = false;
                
                while ( !$leave && !$this->mSource->atEnd() &&
-                               count($this->mBuffer) < $count ) {
+                               strlen($this->mBuffer) < $count ) {
                        $read = $this->mSource->readChunk();
                        
-                       if ( !count($read) ) {
+                       if ( !strlen($read) ) {
                                $leave = true;
                        }
                        
                        $this->mBuffer .= $read;
                }
        
-               if ( count($this->mBuffer) ) {
+               if ( strlen($this->mBuffer) ) {
                        $return = substr( $this->mBuffer, 0, $count );
                        $this->mBuffer = substr( $this->mBuffer, $count );
                }