r80808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80807‎ | r80808 | r80809 >
Date:10:35, 23 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Remainder of some more undefined variables
Modified paths:
  • /trunk/extensions/AntiSpoof/AntiSpoof_body.php (modified) (history)
  • /trunk/extensions/ExtensionDistributor/ExtensionDistributor_body.php (modified) (history)
  • /trunk/extensions/Gadgets/Gadgets_body.php (modified) (history)
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)
  • /trunk/extensions/NewUserMessage/NewUserMessage.class.php (modified) (history)
  • /trunk/extensions/VariablePage/VariablePage.body.php (modified) (history)
  • /trunk/extensions/Vector/Vector.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/Gadgets_body.php
@@ -204,6 +204,7 @@
205205 * @return Mixed: Instance of Gadget class or false if $definition is invalid
206206 */
207207 public static function newFromDefinition( $definition ) {
 208+ $m = array();
208209 if ( !preg_match( '/^\*+ *([a-zA-Z](?:[-_:.\w\d ]*[a-zA-Z0-9])?)(\s*\[.*?\])?\s*((\|[^|]*)+)\s*$/', $definition, $m ) ) {
209210 return false;
210211 }
@@ -437,6 +438,7 @@
438439 $section = '';
439440
440441 foreach ( $g as $line ) {
 442+ $m = array();
441443 if ( preg_match( '/^==+ *([^*:\s|]+?)\s*==+\s*$/', $line, $m ) ) {
442444 $section = $m[1];
443445 }
Index: trunk/extensions/AntiSpoof/AntiSpoof_body.php
@@ -201,6 +201,7 @@
202202 * Convert string into array of Unicode code points as integers
203203 */
204204 public static function stringToList( $str ) {
 205+ $ar = array();
205206 if ( !preg_match_all( '/./us', $str, $ar ) ) {
206207 return array();
207208 }
Index: trunk/extensions/VariablePage/VariablePage.body.php
@@ -15,11 +15,15 @@
1616 global $wgOut, $wgRequest;
1717 global $wgVariablePagePossibilities;
1818
19 - $lang = ( preg_match( '/^[A-Za-z-]+$/', $wgRequest->getVal( 'lang' ) ) ) ? $wgRequest->getVal( 'lang' ) : 'en' ;
 19+ $lang = ( preg_match( '/^[A-Za-z-]+$/', $wgRequest->getVal( 'lang' ) ) )
 20+ ? $wgRequest->getVal( 'lang' )
 21+ : 'en' ;
2022 $utm_source = $wgRequest->getVal( 'utm_source' );
2123 $utm_medium = $wgRequest->getVal( 'utm_medium' );
2224 $utm_campaign = $wgRequest->getVal( 'utm_campaign' );
23 - $referrer = ( $wgRequest->getVal( 'referrer' )) ? $wgRequest->getVal( 'referrer' ) : $wgRequest->getHeader( 'referer' );
 25+ $referrer = ( $wgRequest->getVal( 'referrer' ))
 26+ ? $wgRequest->getVal( 'referrer' )
 27+ : $wgRequest->getHeader( 'referer' );
2428
2529 $query = array();
2630 if ( strlen( $lang ) ) $query[ 'language' ] = $lang;
@@ -76,7 +80,7 @@
7781 global $wgVariablePagePossibilities, $wgVariablePageDefault;
7882
7983 $total_probability = 0;
80 - foreach ( $wgVariablePagePossibilities as $url => $probability ) {
 84+ foreach ( $wgVariablePagePossibilities as $probability ) {
8185 $total_probability += $probability;
8286 }
8387
Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php
@@ -40,6 +40,7 @@
4141
4242 if ( !wfEmptyMsg( 'newusermessage-signatures', $signatures ) ) {
4343 $pattern = '/^\* ?(.*?)$/m';
 44+ $signatureList = array();
4445 preg_match_all( $pattern, $signatures, $signatureList, PREG_SET_ORDER );
4546 if ( count( $signatureList ) > 0 ) {
4647 $rand = rand( 0, count( $signatureList ) - 1 );
Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -41,6 +41,7 @@
4242 $descType = self::BOTTOM_RIGHT;
4343 $defaultLinkAttribs = false;
4444 $realmap = true;
 45+ $extLinks = array();
4546 foreach ( $lines as $line ) {
4647 ++$lineNum;
4748 $externLink = false;
@@ -137,6 +138,7 @@
138139
139140 # Find the link
140141 $link = trim( strstr( $line, '[' ) );
 142+ $m = array();
141143 if ( preg_match( '/^ \[\[ ([^|]*+) \| ([^\]]*+) \]\] \w* $ /x', $link, $m ) ) {
142144 $title = Title::newFromText( $m[1] );
143145 $alt = trim( $m[2] );
Index: trunk/extensions/ExtensionDistributor/ExtensionDistributor_body.php
@@ -314,6 +314,8 @@
315315 return false;
316316 }
317317
 318+ $encResponse = '';
 319+
318320 fwrite( $sock, $cmd . "\000\000\000" );
319321 while ( $sock && !feof( $sock ) ) {
320322 $encResponse .= fread( $sock, 8192 );
Index: trunk/extensions/Vector/Vector.hooks.php
@@ -104,8 +104,8 @@
105105 *
106106 * Adds Vector-releated items to the preferences
107107 *
108 - * @param $out User current user
109 - * @param $skin array list of default user preference controls
 108+ * @param $user User current user
 109+ * @param $defaultPreferences array list of default user preference controls
110110 */
111111 public static function getPreferences( $user, &$defaultPreferences ) {
112112 global $wgVectorFeatures;

Status & tagging log