Collapse some nested if statements
[lhc/web/wiklou.git] / includes / cache / HTMLFileCache.php
index 3a89066..a0d61b2 100644 (file)
@@ -128,10 +128,8 @@ class HTMLFileCache extends FileCacheBase {
                        return false;
                }
 
-               if ( $mode === self::MODE_NORMAL ) {
-                       if ( $user->getNewtalk() ) {
-                               return false;
-                       }
+               if ( ( $mode === self::MODE_NORMAL ) && $user->getNewtalk() ) {
+                       return false;
                }
 
                // Allow extensions to disable caching
@@ -211,18 +209,14 @@ class HTMLFileCache extends FileCacheBase {
                }
 
                // gzip output to buffer as needed and set headers...
-               if ( $this->useGzip() ) {
-                       // @todo Ugly wfClientAcceptsGzip() function - use context!
-                       if ( wfClientAcceptsGzip() ) {
-                               header( 'Content-Encoding: gzip' );
+               // @todo Ugly wfClientAcceptsGzip() function - use context!
+               if ( $this->useGzip() && wfClientAcceptsGzip() ) {
+                       header( 'Content-Encoding: gzip' );
 
-                               return $compressed;
-                       } else {
-                               return $text;
-                       }
-               } else {
-                       return $text;
+                       return $compressed;
                }
+
+               return $text;
        }
 
        /**