Switch some HTMLForms in special pages to OOUI
[lhc/web/wiklou.git] / includes / Revision.php
index 3ba6157..5939715 100644 (file)
@@ -194,8 +194,8 @@ class Revision implements IDBAccessObject {
 
                if ( !isset( $attribs['title'] )
                        && isset( $row->ar_namespace )
-                       && isset( $row->ar_title ) ) {
-
+                       && isset( $row->ar_title )
+               ) {
                        $attribs['title'] = Title::makeTitle( $row->ar_namespace, $row->ar_title );
                }
 
@@ -1284,8 +1284,14 @@ class Revision implements IDBAccessObject {
 
                if ( $wgCompressRevisions ) {
                        if ( function_exists( 'gzdeflate' ) ) {
-                               $text = gzdeflate( $text );
-                               $flags[] = 'gzip';
+                               $deflated = gzdeflate( $text );
+
+                               if ( $deflated === false ) {
+                                       wfLogWarning( __METHOD__ . ': gzdeflate() failed' );
+                               } else {
+                                       $text = $deflated;
+                                       $flags[] = 'gzip';
+                               }
                        } else {
                                wfDebug( __METHOD__ . " -- no zlib support, not compressing\n" );
                        }
@@ -1306,6 +1312,11 @@ class Revision implements IDBAccessObject {
                        # This can be done periodically via maintenance/compressOld.php, and
                        # as pages are saved if $wgCompressRevisions is set.
                        $text = gzinflate( $text );
+
+                       if ( $text === false ) {
+                               wfLogWarning( __METHOD__ . ': gzinflate() failed' );
+                               return false;
+                       }
                }
 
                if ( in_array( 'object', $flags ) ) {