diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/media/DjVu.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/media/DjVu.php')
-rw-r--r-- | includes/media/DjVu.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 0a39a2cf..b9e89d9d 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -185,7 +185,7 @@ class DjVuHandler extends ImageHandler { } $cmd .= ' > ' . wfEscapeShellArg( $dstPath ) . ') 2>&1'; wfProfileIn( 'ddjvu' ); - wfDebug( __METHOD__.": $cmd\n" ); + wfDebug( __METHOD__ . ": $cmd\n" ); $retval = ''; $err = wfShellExec( $cmd, $retval ); wfProfileOut( 'ddjvu' ); @@ -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 ) { @@ -311,7 +310,7 @@ class DjVuHandler extends ImageHandler { return false; } - $o = $tree->BODY[0]->OBJECT[$page-1]; + $o = $tree->BODY[0]->OBJECT[$page - 1]; if ( $o ) { return array( 'width' => intval( $o['width'] ), @@ -328,7 +327,7 @@ class DjVuHandler extends ImageHandler { return false; } - $o = $tree->BODY[0]->PAGE[$page-1]; + $o = $tree->BODY[0]->PAGE[$page - 1]; if ( $o ) { $txt = $o['value']; return $txt; |