From 9b52cb83b148f3c26cfc3a30c306abbc893b6f4c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 2 Sep 2010 22:15:20 +0000 Subject: [PATCH] Add some $retval = '' before some wfShellExec --- includes/DjVuImage.php | 3 ++- includes/media/Bitmap.php | 3 ++- includes/media/DjVu.php | 3 ++- includes/media/SVG.php | 3 ++- includes/parser/LinkHolderArray.php | 4 +++- includes/parser/ParserOptions.php | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/includes/DjVuImage.php b/includes/DjVuImage.php index 576991b9ce..330fe4a7d2 100644 --- a/includes/DjVuImage.php +++ b/includes/DjVuImage.php @@ -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 diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 3f39fab762..ce42ef58a3 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -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" ); diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 73b73a22c2..84d6828ca2 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -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 ); diff --git a/includes/media/SVG.php b/includes/media/SVG.php index fae30912f9..cfb02d45fc 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -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 ); diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index aad88b747a..9175b5af0c 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -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; } diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 36c3f36f5b..975863985f 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -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 ); } -- 2.20.1