r76665 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76664‎ | r76665 | r76666 >
Date:19:12, 14 November 2010
Author:ashley
Status:ok (Comments)
Tags:
Comment:
SocialProfile: bug #25805 - shut up warnings in Special:UpdateProfile. Patch by Frozen Wind.
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
@@ -228,6 +228,8 @@
229229 $month = $dob[0];
230230 $day = $dob[1];
231231 $birthday_date = $year . '-' . $month . '-' . $day;
 232+ } else {
 233+ $birthday_date = '';
232234 }
233235 return ( $birthday_date );
234236 }
@@ -239,6 +241,8 @@
240242 $month = $dob[1];
241243 $day = $dob[2];
242244 $birthday_date = $month . '/' . $day; // . '/' . $year;
 245+ } else {
 246+ $birthday_date = '';
243247 }
244248 return $birthday_date;
245249 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r77336SocialProfile: follow-up to r76665 - prevent notices about undefined variablesashley18:39, 26 November 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   00:16, 18 November 2010

I've seen many warnings in the previous (unpatched) situation. PHP fools you again!

#Comment by MarkAHershberger (talk | contribs)   05:03, 25 November 2010

If this is the user's first visit to the Special:UpdateProfile/personal, then they see

Notice: Undefined variable: movies in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 556
Notice: Undefined variable: tv in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 561
Notice: Undefined variable: music in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 566
Notice: Undefined variable: books in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 571
Notice: Undefined variable: magazines in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 576
Notice: Undefined variable: videogames in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 581
Notice: Undefined variable: snacks in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 589
Notice: Undefined variable: drinks in /home/mah/work/code/mediawiki/mw-svn/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php on line 594

Similar messages involving $custom[1-4] on Special:UpdateProfile/custom

#Comment by Jack Phoenix (talk | contribs)   18:52, 26 November 2010

Fixed in r77336.

Status & tagging log