http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72238

Revision: 72238
Author:   reedy
Date:     2010-09-02 22:15:20 +0000 (Thu, 02 Sep 2010)

Log Message:
-----------
Add some $retval = '' before some wfShellExec

Modified Paths:
--------------
    trunk/phase3/includes/DjVuImage.php
    trunk/phase3/includes/media/Bitmap.php
    trunk/phase3/includes/media/DjVu.php
    trunk/phase3/includes/media/SVG.php
    trunk/phase3/includes/parser/LinkHolderArray.php
    trunk/phase3/includes/parser/ParserOptions.php

Modified: trunk/phase3/includes/DjVuImage.php
===================================================================
--- trunk/phase3/includes/DjVuImage.php 2010-09-02 22:11:32 UTC (rev 72237)
+++ trunk/phase3/includes/DjVuImage.php 2010-09-02 22:15:20 UTC (rev 72238)
@@ -248,7 +248,8 @@
                        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

Modified: trunk/phase3/includes/media/Bitmap.php
===================================================================
--- trunk/phase3/includes/media/Bitmap.php      2010-09-02 22:11:32 UTC (rev 
72237)
+++ trunk/phase3/includes/media/Bitmap.php      2010-09-02 22:15:20 UTC (rev 
72238)
@@ -362,7 +362,8 @@
                        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" );

Modified: trunk/phase3/includes/media/DjVu.php
===================================================================
--- trunk/phase3/includes/media/DjVu.php        2010-09-02 22:11:32 UTC (rev 
72237)
+++ trunk/phase3/includes/media/DjVu.php        2010-09-02 22:15:20 UTC (rev 
72238)
@@ -108,7 +108,8 @@
                $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 );

Modified: trunk/phase3/includes/media/SVG.php
===================================================================
--- trunk/phase3/includes/media/SVG.php 2010-09-02 22:11:32 UTC (rev 72237)
+++ trunk/phase3/includes/media/SVG.php 2010-09-02 22:15:20 UTC (rev 72238)
@@ -82,6 +82,7 @@
        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 @@
                        ) . " 2>&1";
                        wfProfileIn( 'rsvg' );
                        wfDebug( __METHOD__.": $cmd\n" );
-                       $err = wfShellExec( $cmd, $retval );
+                       $err = wfShellExec( $cmd, &$retval );
                        wfProfileOut( 'rsvg' );
                }
                $removed = $this->removeBadFile( $dstPath, $retval );

Modified: trunk/phase3/includes/parser/LinkHolderArray.php
===================================================================
--- trunk/phase3/includes/parser/LinkHolderArray.php    2010-09-02 22:11:32 UTC 
(rev 72237)
+++ trunk/phase3/includes/parser/LinkHolderArray.php    2010-09-02 22:15:20 UTC 
(rev 72238)
@@ -345,7 +345,9 @@
                                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;
                                }

Modified: trunk/phase3/includes/parser/ParserOptions.php
===================================================================
--- trunk/phase3/includes/parser/ParserOptions.php      2010-09-02 22:11:32 UTC 
(rev 72237)
+++ trunk/phase3/includes/parser/ParserOptions.php      2010-09-02 22:15:20 UTC 
(rev 72238)
@@ -38,6 +38,7 @@
        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 @@
        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 ); }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to