* Fix excessive memory usage in MessageCache::loadFromLocal()
}
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
global $wgMessageCache;
- $text = $this->getContent();
+ if ( $this->getID() == 0 ) {
+ $text = false;
+ } else {
+ $text = $this->getContent();
+ }
$wgMessageCache->replace( $this->mTitle->getDBkey(), $text );
}
$this->view();
$localHash = fread( $file, 32 );
if ( $hash === $localHash ) {
// All good, get the rest of it
- $serialized = fread( $file, 20000000 );
+ $serialized = '';
+ while ( !feof( $file ) ) {
+ $serialized .= fread( $file, 100000 );
+ }
$this->setCache( unserialize( $serialized ) );
}
fclose( $file );