r80806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80805‎ | r80806 | r80807 >
Date:10:33, 23 January 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fixup some missing variable definitions
Modified paths:
  • /trunk/extensions/ActiveAbstract/AbstractFilter.php (modified) (history)
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)
  • /trunk/extensions/PdfHandler/PdfHandler.image.php (modified) (history)
  • /trunk/extensions/PdfHandler/PdfHandler_body.php (modified) (history)
  • /trunk/extensions/Poem/Poem.php (modified) (history)
  • /trunk/extensions/ScanSet/ScanSet_body.php (modified) (history)
  • /trunk/extensions/SimpleAntiSpam/SimpleAntiSpam.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Poem/Poem.php
@@ -34,6 +34,13 @@
3535 return true;
3636 }
3737
 38+/**
 39+ * @param $in
 40+ * @param array $param
 41+ * @param $parser Parser
 42+ * @param bool $frame
 43+ * @return string
 44+ */
3845 function PoemExtension( $in, $param=array(), $parser=null, $frame=false ) {
3946
4047 /* using newlines in the text will cause the parser to add <p> tags,
Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -74,6 +74,7 @@
7575 $talkTag = $wgRequest->getBool( 'usettag' ) ?
7676 trim( $wgRequest->getVal( 'talktag' ) ) : '';
7777
 78+ $m = array();
7879 # An IPv4? An IPv6? CIDR included?
7980 if ( IP::isIPAddress( $user ) ) {
8081 $ip = IP::sanitizeIP( $user );
@@ -1145,6 +1146,7 @@
11461147 protected function getIpConds( $db, $ip, $xfor = false ) {
11471148 $type = ( $xfor ) ? 'xff' : 'ip';
11481149 // IPv4 CIDR, 16-32 bits
 1150+ $matches = array();
11491151 if ( preg_match( '#^(\d+\.\d+\.\d+\.\d+)/(\d+)$#', $ip, $matches ) ) {
11501152 if ( $matches[2] < 16 || $matches[2] > 32 ) {
11511153 return false; // invalid
Index: trunk/extensions/ActiveAbstract/AbstractFilter.php
@@ -182,6 +182,8 @@
183183 $sentence = ".*?$end+";
184184 $firsttwo = "/^($sentence$sentence)/u";
185185
 186+ $matches = array();
 187+
186188 if ( preg_match( $firsttwo, $text, $matches ) ) {
187189 return $matches[1];
188190 } else {
Index: trunk/extensions/ScanSet/ScanSet_body.php
@@ -186,6 +186,7 @@
187187
188188 $volumes = array();
189189 while ( ( $file = readdir( $dir ) ) !== false ) {
 190+ $m = array();
190191 if ( preg_match( '/^VOL([0-9]+) (.*)$/', $file, $m ) ) {
191192 $volumes[$m[1]] = $m[2];
192193 // Is this the current volume? Use strcmp to enforce leading zeros
@@ -226,6 +227,7 @@
227228 $passedCurrent = false;
228229 for ( $i = 0; $i < count( $lines ); $i++) {
229230 $line = $lines[$i];
 231+ $m = array();
230232 if ( !preg_match( '/^(\w+)\.(\w+),(.*)$/', trim( $line ), $m ) ) {
231233 $this->doError( 'index_file_error', $i + 1 );
232234 return false;
Index: trunk/extensions/SimpleAntiSpam/SimpleAntiSpam.php
@@ -32,6 +32,10 @@
3333 }
3434
3535 //check for the field and if it isn't empty, negate the save
 36+/**
 37+ * @param $editpage EditPage
 38+ * @return bool
 39+ */
3640 function efSimpleAntiSpamCheck( $editpage ) {
3741 global $wgRequest, $wgUser;
3842 $spam = $wgRequest->getText( 'wpAntispam' );
@@ -43,7 +47,7 @@
4448 '" submitted bogus field "' .
4549 $spam .
4650 '"' );
47 - $editpage->spamPage();
 51+ $editpage->spamPageWithContent();
4852 return false;
4953 }
5054 return true;
Index: trunk/extensions/PdfHandler/PdfHandler.image.php
@@ -85,6 +85,7 @@
8686 " -enc UTF-8 " . # Report metadata as UTF-8 text...
8787 " -l 9999999 " . # Report page sizes for all pages
8888 wfEscapeShellArg( $this->mFilename );
 89+ $retval = '';
8990 $dump = wfShellExec( $cmd, $retval );
9091 $data = $this->convertDumpToArray( $dump );
9192 wfProfileOut( 'pdfinfo' );
@@ -97,6 +98,7 @@
9899 wfProfileIn( 'pdftotext' );
99100 $cmd = wfEscapeShellArg( $wgPdftoText ) . ' '. wfEscapeShellArg( $this->mFilename ) . ' - ';
100101 wfDebug( __METHOD__.": $cmd\n" );
 102+ $retval = '';
101103 $txt = wfShellExec( $cmd, $retval );
102104 wfProfileOut( 'pdftotext' );
103105 if( $retval == 0 ) {
@@ -126,6 +128,7 @@
127129 if( count( $bits ) > 1 ) {
128130 $key = trim( $bits[0] );
129131 $value = trim( $bits[1] );
 132+ $matches = array();
130133 if( preg_match( '/^Page +(\d+) size$/', $key, $matches ) ) {
131134 $data['pages'][$matches[1]]['Page size'] = $value;
132135 } else {
Index: trunk/extensions/PdfHandler/PdfHandler_body.php
@@ -129,6 +129,7 @@
130130
131131 wfProfileIn( 'PdfHandler' );
132132 wfDebug( __METHOD__ . ": $cmd\n" );
 133+ $retval = '';
133134 $err = wfShellExec( $cmd, $retval );
134135 wfProfileOut( 'PdfHandler' );
135136

Comments

#Comment by 😂 (talk | contribs)   18:49, 4 February 2011
-		$editpage->spamPage();
+		$editpage->spamPageWithContent();

Do these methods do the same thing? Otherwise this is ok.

#Comment by Reedy (talk | contribs)   22:49, 23 March 2011
  • @deprecated Use method spamPageWithContent() instead

static function spamPage( $match = false ) {


It seems to be identical, with some extra stuff tagged on...

Status & tagging log