Merge "API: Improve handling of interwiki redirects when resolving"
[lhc/web/wiklou.git] / includes / media / DjVu.php
index 200d526..3072a62 100644 (file)
@@ -73,7 +73,7 @@ class DjVuHandler extends ImageHandler {
         * @return bool
         */
        function validateParam( $name, $value ) {
-               if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) {
+               if ( $name === 'page' && trim( $value ) !== (string)intval( $value ) ) {
                        // Extra junk on the end of page, probably actually a caption
                        // e.g. [[File:Foo.djvu|thumb|Page 3 of the document shows foo]]
                        return false;
@@ -188,7 +188,7 @@ class DjVuHandler extends ImageHandler {
                if ( $image->getSize() >= 1e7 ) { // 10MB
                        $work = new PoolCounterWorkViaCallback( 'GetLocalFileCopy', sha1( $image->getName() ),
                                array(
-                                       'doWork' => function() use ( $image ) {
+                                       'doWork' => function () use ( $image ) {
                                                return $image->getLocalRefPath();
                                        }
                                )
@@ -266,6 +266,7 @@ class DjVuHandler extends ImageHandler {
         *
         * @param File $file The DjVu file in question
         * @return string XML metadata as a string.
+        * @throws MWException
         */
        private function getUnserializedMetadata( File $file ) {
                $metadata = $file->getMetadata();
@@ -312,7 +313,6 @@ class DjVuHandler extends ImageHandler {
 
                        return false;
                }
-               wfProfileIn( __METHOD__ );
 
                wfSuppressWarnings();
                try {
@@ -338,7 +338,6 @@ class DjVuHandler extends ImageHandler {
                        wfDebug( "Bogus multipage XML metadata on '{$image->getName()}'\n" );
                }
                wfRestoreWarnings();
-               wfProfileOut( __METHOD__ );
                if ( $gettext ) {
                        return $image->djvuTextTree;
                } else {