Fixup whitespace from r71592
authorSam Reed <reedy@users.mediawiki.org>
Tue, 24 Aug 2010 22:34:44 +0000 (22:34 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 24 Aug 2010 22:34:44 +0000 (22:34 +0000)
if ( !($buf == self::$png_sig) ) { to if ( $buf != self::$png_sig ) {

Add a couple of braces

includes/media/PNGMetadataExtractor.php
maintenance/tests/SearchEngineTest.php

index 1c9add9..6a931e6 100644 (file)
@@ -33,12 +33,13 @@ class PNGMetadataExtractor {
                
                $fh = fopen( $filename, 'r' );
                
-               if (!$fh)
+               if (!$fh) {
                        throw new Exception( __METHOD__ . ": Unable to open file $filename" );
+               }
                
                // Check for the PNG header
                $buf = fread( $fh, 8 );
-               if ( !($buf == self::$png_sig) ) {
+               if ( $buf != self::$png_sig ) {
                        throw new Exception( __METHOD__ . ": Not a valid PNG file; header: $buf" );
                }
 
@@ -46,21 +47,21 @@ class PNGMetadataExtractor {
                while( !feof( $fh ) ) {
                        $buf = fread( $fh, 4 );
                        if( !$buf ) {
-                throw new Exception( __METHOD__ . ": Read error" );
-            }
+                               throw new Exception( __METHOD__ . ": Read error" );
+                       }
                        $chunk_size = unpack( "N", $buf);
                        $chunk_size = $chunk_size[1];
 
                        $chunk_type = fread( $fh, 4 );
                        if( !$chunk_type ) {
-                throw new Exception( __METHOD__ . ": Read error" );
-            }
+                               throw new Exception( __METHOD__ . ": Read error" );
+                       }
 
                        if ( $chunk_type == "acTL" ) {
                                $buf = fread( $fh, $chunk_size );
                                if( !$buf ) {
-                    throw new Exception( __METHOD__ . ": Read error" );
-                }
+                                       throw new Exception( __METHOD__ . ": Read error" );
+                               }
 
                                $actl = unpack( "Nframes/Nplays", $buf );
                                $frameCount = $actl['frames'];
@@ -68,8 +69,8 @@ class PNGMetadataExtractor {
                        } elseif ( $chunk_type == "fcTL" ) {
                                $buf = fread( $fh, $chunk_size );
                                if( !$buf ) {
-                    throw new Exception( __METHOD__ . ": Read error" );
-                }
+                                       throw new Exception( __METHOD__ . ": Read error" );
+                               }
                                $buf = substr( $buf, 20 );      
 
                                $fctldur = unpack( "ndelay_num/ndelay_den", $buf );
index 47d03e2..4fe879f 100644 (file)
@@ -34,12 +34,12 @@ class SearchEngineTest extends MediaWikiTestSetup {
        }
 
        function removeSearchData() {
-            return;
-            /*while ( count( $this->pageList ) ) {
-                list( $title, $id ) = array_pop( $this->pageList );
-                $article = new Article( $title, $id );
-                $article->doDeleteArticle( "Search Test" );
-            }*/
+        return;
+        /*while ( count( $this->pageList ) ) {
+            list( $title, $id ) = array_pop( $this->pageList );
+            $article = new Article( $title, $id );
+            $article->doDeleteArticle( "Search Test" );
+        }*/
        }
 
        function fetchIds( $results ) {