* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to $user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @since 1.21
* @return Content|null
? SqlBlobStore::makeAddressFromTextId( $row->old_id )
: null;
- return self::getBlobStore( $wiki )->expandBlob( $text, $flags, $cacheKey );
+ $revisionText = self::getBlobStore( $wiki )->expandBlob( $text, $flags, $cacheKey );
+
+ if ( $revisionText === false ) {
+ if ( isset( $row->old_id ) ) {
+ wfLogWarning( __METHOD__ . ": Bad data in text row {$row->old_id}! " );
+ } else {
+ wfLogWarning( __METHOD__ . ": Bad data in text row! " );
+ }
+ return false;
+ }
+
+ return $revisionText;
}
/**
* @return string|bool Decompressed text, or false on failure
*/
public static function decompressRevisionText( $text, $flags ) {
+ if ( $text === false ) {
+ // Text failed to be fetched; nothing to do
+ return false;
+ }
+
return self::getBlobStore()->decompressData( $text, $flags );
}