Merge "Improve behavior of IP::toUnsigned on Windows"
[lhc/web/wiklou.git] / includes / media / DjVu.php
index a41521d..b9e89d9 100644 (file)
@@ -246,24 +246,23 @@ class DjVuHandler extends ImageHandler {
                        $image->dejaMetaTree = false;
                        $image->djvuTextTree = false;
                        $tree = new SimpleXMLElement( $metadata );
-                       if( $tree->getName() == 'mw-djvu' ) {
-                               foreach( $tree->children() as $b ) {
-                                       if( $b->getName() == 'DjVuTxt' ) {
+                       if ( $tree->getName() == 'mw-djvu' ) {
+                               foreach ( $tree->children() as $b ) {
+                                       if ( $b->getName() == 'DjVuTxt' ) {
                                                $image->djvuTextTree = $b;
-                                       }
-                                       elseif ( $b->getName() == 'DjVuXML' ) {
+                                       } elseif ( $b->getName() == 'DjVuXML' ) {
                                                $image->dejaMetaTree = $b;
                                        }
                                }
                        } else {
                                $image->dejaMetaTree = $tree;
                        }
-               } catch( Exception $e ) {
+               } catch ( Exception $e ) {
                        wfDebug( "Bogus multipage XML metadata on '{$image->getName()}'\n" );
                }
                wfRestoreWarnings();
                wfProfileOut( __METHOD__ );
-               if( $gettext ) {
+               if ( $gettext ) {
                        return $image->djvuTextTree;
                } else {
                        return $image->dejaMetaTree;
@@ -294,7 +293,7 @@ class DjVuHandler extends ImageHandler {
        }
 
        function isMetadataValid( $image, $metadata ) {
-               return !empty( $metadata ) && $metadata != serialize(array());
+               return !empty( $metadata ) && $metadata != serialize( array() );
        }
 
        function pageCount( $image ) {