Add some $retval = '' before some wfShellExec
authorSam Reed <reedy@users.mediawiki.org>
Thu, 2 Sep 2010 22:15:20 +0000 (22:15 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 2 Sep 2010 22:15:20 +0000 (22:15 +0000)
includes/DjVuImage.php
includes/media/Bitmap.php
includes/media/DjVu.php
includes/media/SVG.php
includes/parser/LinkHolderArray.php
includes/parser/ParserOptions.php

index 576991b..330fe4a 100644 (file)
@@ -248,7 +248,8 @@ class DjVuImage {
                        wfProfileIn( 'djvutxt' );
                        $cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename ) ;
                        wfDebug( __METHOD__.": $cmd\n" );
-                       $txt = wfShellExec( $cmd, $retval );
+                       $retval = '';
+                       $txt = wfShellExec( $cmd, &$retval );
                        wfProfileOut( 'djvutxt' );
                        if( $retval == 0) {
                                # Get rid of invalid UTF-8, strip control characters
index 3f39fab..ce42ef5 100644 (file)
@@ -362,7 +362,8 @@ class BitmapHandler extends ImageHandler {
                        global $wgImageMagickConvertCommand;
                        $cmd = wfEscapeShellArg( $wgImageMagickConvertCommand ) . ' -version';
                        wfDebug( __METHOD__.": Running convert -version\n" );
-                       $return = wfShellExec( $cmd, $retval );
+                       $retval = '';
+                       $return = wfShellExec( $cmd, &$retval );
                        $x = preg_match('/Version: ImageMagick ([0-9]*\.[0-9]*\.[0-9]*)/', $return, $matches);
                        if( $x != 1 ) {
                                wfDebug( __METHOD__.": ImageMagick version check failed\n" );
index 73b73a2..84d6828 100644 (file)
@@ -108,7 +108,8 @@ class DjVuHandler extends ImageHandler {
                $cmd .= ' > ' . wfEscapeShellArg($dstPath) . ') 2>&1';
                wfProfileIn( 'ddjvu' );
                wfDebug( __METHOD__.": $cmd\n" );
-               $err = wfShellExec( $cmd, $retval );
+               $retval = '';
+               $err = wfShellExec( $cmd, &$retval );
                wfProfileOut( 'ddjvu' );
 
                $removed = $this->removeBadFile( $dstPath, $retval );
index fae3091..cfb02d4 100644 (file)
@@ -82,6 +82,7 @@ class SvgHandler extends ImageHandler {
        public function rasterize( $srcPath, $dstPath, $width, $height ) {
                global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath;
                $err = false;
+               $retval = '';
                if ( isset( $wgSVGConverters[$wgSVGConverter] ) ) {
                        $cmd = str_replace(
                                array( '$path/', '$width', '$height', '$input', '$output' ),
@@ -94,7 +95,7 @@ class SvgHandler extends ImageHandler {
                        ) . " 2>&1";
                        wfProfileIn( 'rsvg' );
                        wfDebug( __METHOD__.": $cmd\n" );
-                       $err = wfShellExec( $cmd, $retval );
+                       $err = wfShellExec( $cmd, &$retval );
                        wfProfileOut( 'rsvg' );
                }
                $removed = $this->removeBadFile( $dstPath, $retval );
index aad88b7..9175b5a 100644 (file)
@@ -345,7 +345,9 @@ class LinkHolderArray {
                                extract( $titlesAttrs[$i] );
                                if($textVariant != $titleText){
                                        $variantTitle = Title::makeTitle( $ns, $textVariant );
-                                       if( is_null( $variantTitle ) ) { continue; }
+                                       if( is_null( $variantTitle ) ) {
+                                               continue;
+                                       }
                                        $linkBatch->addObj( $variantTitle );
                                        $variantMap[$variantTitle->getPrefixedDBkey()][] = $key;
                                }
index 36c3f36..9758639 100644 (file)
@@ -38,6 +38,7 @@ class ParserOptions {
        var $mMath;                      # User math preference (as integer)
        var $mUserLang;                  # Language code of the User language.
        var $mThumbSize;                 # Thumb size preferred by the user.
+       var $mCleanSignatures;           #
 
        var $mUser;                      # Stored user object, just used to initialise the skin
        var $mIsPreview;                 # Parsing the page for a "preview" operation
@@ -134,7 +135,7 @@ class ParserOptions {
        function setExternalLinkTarget( $x )        { return wfSetVar( $this->mExternalLinkTarget, $x ); }
        function setMath( $x )                      { return wfSetVar( $this->mMath, $x ); }
        function setUserLang( $x )                  { return wfSetVar( $this->mUserLang, $x ); }
-       function setThumbSize()                     { return wfSetVar( $this->mThumbSize, $x ); }
+       function setThumbSize( $x )                 { return wfSetVar( $this->mThumbSize, $x ); }
        
        function setIsPreview( $x )                 { return wfSetVar( $this->mIsPreview, $x ); }
        function setIsSectionPreview( $x )          { return wfSetVar( $this->mIsSectionPreview, $x ); }