r70626 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70625‎ | r70626 | r70627 >
Date:12:43, 7 August 2010
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: fix a bunch of PHP notices about undefined variables
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
@@ -346,10 +346,10 @@
347347 $websites = $s->up_websites;
348348 }
349349
350 - if ( !$location_country ) {
 350+ if ( !isset( $location_country ) ) {
351351 $location_country = wfMsgForContent( 'user-profile-default-country' );
352352 }
353 - if ( !$hometown_country ) {
 353+ if ( !isset( $hometown_country ) ) {
354354 $hometown_country = wfMsgForContent( 'user-profile-default-country' );
355355 }
356356
@@ -398,16 +398,16 @@
399399 $form .= '<div class="profile-update">
400400 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-location' ) . '</p>
401401 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-city' ) . '</p>
402 - <p class="profile-update-unit"><input type="text" size="25" name="location_city" id="location_city" value="' . $location_city . '" /></p>
 402+ <p class="profile-update-unit"><input type="text" size="25" name="location_city" id="location_city" value="' . ( isset( $location_city ) ? $location_city : '' ) . '" /></p>
403403 <div class="cleared"></div>
404404 <p class="profile-update-unit-left" id="location_state_label">' . wfMsg( 'user-profile-personal-country' ) . '</p>';
405405 $form .= '<p class="profile-update-unit">';
406406 $form .= '<span id="location_state_form">';
407407 $form .= "</span>
408408 <script type=\"text/javascript\">
409 - displaySection(\"location_state\",\"" . $location_country . "\",\"" . $location_state . "\")
 409+ displaySection(\"location_state\",\"" . $location_country . "\",\"" . ( isset( $location_state ) ? $location_state : '' ) . "\");
410410 </script>";
411 - $form .= "<select name=\"location_country\" id=\"location_country\" onhhange=\"displaySection('location_state',this.value,'')\"><option></option>";
 411+ $form .= "<select name=\"location_country\" id=\"location_country\" onchange=\"displaySection('location_state',this.value,'')\"><option></option>";
412412
413413 foreach ( $countries as $country ) {
414414 $form .= "<option value=\"{$country}\"" . ( ( $country == $location_country ) ? ' selected="selected"' : '' ) . ">";
@@ -423,14 +423,14 @@
424424 $form .= '<div class="profile-update">
425425 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-hometown' ) . '</p>
426426 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-city' ) . '</p>
427 - <p class="profile-update-unit"><input type="text" size="25" name="hometown_city" id="hometown_city" value="' . $hometown_city . '" /></p>
 427+ <p class="profile-update-unit"><input type="text" size="25" name="hometown_city" id="hometown_city" value="' . ( isset( $hometown_city ) ? $hometown_city : '' ) . '" /></p>
428428 <div class="cleared"></div>
429429 <p class="profile-update-unit-left" id="hometown_state_label">' . wfMsg( 'user-profile-personal-country' ) . '</p>
430430 <p class="profile-update-unit">';
431431 $form .= '<span id="hometown_state_form">';
432432 $form .= "</span>
433433 <script type=\"text/javascript\">
434 - displaySection(\"hometown_state\",\"" . $hometown_country . "\",\"" . $hometown_state . "\")
 434+ displaySection(\"hometown_state\",\"" . $hometown_country . "\",\"" . ( isset( $hometown_state ) ? $hometown_state : '' ) . "\");
435435 </script>";
436436 $form .= "<select name=\"hometown_country\" id=\"hometown_country\" onchange=\"displaySection('hometown_state',this.value,'')\"><option></option>";
437437
@@ -448,7 +448,7 @@
449449 $form .= '<div class="profile-update">
450450 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-birthday' ) . '</p>
451451 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-birthdate' ) . '</p>
452 - <p class="profile-update-unit"><input type="text" size="25" name="birthday" id="birthday" value="' . $birthday . '" /></p>
 452+ <p class="profile-update-unit"><input type="text" size="25" name="birthday" id="birthday" value="' . ( isset( $birthday ) ? $birthday : '' ) . '" /></p>
453453 <div class="cleared"></div>
454454 </div><div class="cleared"></div>';
455455
@@ -456,7 +456,7 @@
457457 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-aboutme' ) . '</p>
458458 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-aboutme' ) . '</p>
459459 <p class="profile-update-unit">
460 - <textarea name="about" id="about" rows="3" cols="75">' . $about . '</textarea>
 460+ <textarea name="about" id="about" rows="3" cols="75">' . ( isset( $about ) ? $about : '' ) . '</textarea>
461461 </p>
462462 <div class="cleared"></div>
463463 </div>
@@ -466,7 +466,7 @@
467467 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-work' ) . '</p>
468468 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-occupation' ) . '</p>
469469 <p class="profile-update-unit">
470 - <textarea name="occupation" id="occupation" rows="2" cols="75">' . $occupation . '</textarea>
 470+ <textarea name="occupation" id="occupation" rows="2" cols="75">' . ( isset( $occupation ) ? $occupation : '' ) . '</textarea>
471471 </p>
472472 <div class="cleared"></div>
473473 </div>
@@ -476,7 +476,7 @@
477477 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-education' ) . '</p>
478478 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-schools' ) . '</p>
479479 <p class="profile-update-unit">
480 - <textarea name="schools" id="schools" rows="2" cols="75">' . $schools . '</textarea>
 480+ <textarea name="schools" id="schools" rows="2" cols="75">' . ( isset( $schools ) ? $schools : '' ) . '</textarea>
481481 </p>
482482 <div class="cleared"></div>
483483 </div>
@@ -486,7 +486,7 @@
487487 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-places' ) . '</p>
488488 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-placeslived' ) . '</p>
489489 <p class="profile-update-unit">
490 - <textarea name="places" id="places" rows="3" cols="75">' . $places . '</textarea>
 490+ <textarea name="places" id="places" rows="3" cols="75">' . ( isset( $places ) ? $places : '' ) . '</textarea>
491491 </p>
492492 <div class="cleared"></div>
493493 </div>
@@ -496,7 +496,7 @@
497497 <p class="profile-update-title">' . wfMsg( 'user-profile-personal-web' ) . '</p>
498498 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-websites' ) . '</p>
499499 <p class="profile-update-unit">
500 - <textarea name="websites" id="websites" rows="2" cols="75">' . $websites . '</textarea>
 500+ <textarea name="websites" id="websites" rows="2" cols="75">' . ( isset( $websites ) ? $websites : '' ) . '</textarea>
501501 </p>
502502 <div class="cleared"></div>
503503 </div>
@@ -608,22 +608,22 @@
609609 $form .= '<div class="profile-info clearfix">
610610 <div class="profile-update">
611611 <p class="profile-update-title">' . wfMsg( 'user-profile-preferences-emails' ) . '</p>
612 - <p class="profile-update-row">
613 - ' . wfMsg( 'user-profile-preferences-emails-personalmessage' ) . '
614 - <input type="checkbox" size="25" name="notify_message" id="notify_message" value="1"' . ( ( $wgUser->getIntOption( 'notifymessage', 1 ) == 1 ) ? 'checked' : '' ) . '/>
 612+ <p class="profile-update-row">'
 613+ . wfMsg( 'user-profile-preferences-emails-personalmessage' ) .
 614+ ' <input type="checkbox" size="25" name="notify_message" id="notify_message" value="1"' . ( ( $wgUser->getIntOption( 'notifymessage', 1 ) == 1 ) ? 'checked' : '' ) . '/>
615615 </p>
616 - <p class="profile-update-row">
617 - ' . wfMsg( 'user-profile-preferences-emails-friendfoe' ) . '
618 - <input type="checkbox" size="25" class="createbox" name="notify_friend" id="notify_friend" value="1" ' . ( ( $wgUser->getIntOption( 'notifyfriendrequest', 1 ) == 1 ) ? 'checked' : '' ) . '/>
 616+ <p class="profile-update-row">'
 617+ . wfMsg( 'user-profile-preferences-emails-friendfoe' ) .
 618+ ' <input type="checkbox" size="25" class="createbox" name="notify_friend" id="notify_friend" value="1" ' . ( ( $wgUser->getIntOption( 'notifyfriendrequest', 1 ) == 1 ) ? 'checked' : '' ) . '/>
619619 </p>
620 - <p class="profile-update-row">
621 - ' . wfMsg( 'user-profile-preferences-emails-gift' ) . '
622 - <input type="checkbox" size="25" name="notify_gift" id="notify_gift" value="1" ' . ( ( $wgUser->getIntOption( 'notifygift', 1 ) == 1 ) ? 'checked' : '' ) . '/>
 620+ <p class="profile-update-row">'
 621+ . wfMsg( 'user-profile-preferences-emails-gift' ) .
 622+ ' <input type="checkbox" size="25" name="notify_gift" id="notify_gift" value="1" ' . ( ( $wgUser->getIntOption( 'notifygift', 1 ) == 1 ) ? 'checked' : '' ) . '/>
623623 </p>
624624
625 - <p class="profile-update-row">
626 - ' . wfMsg( 'user-profile-preferences-emails-level' ) . '
627 - <input type="checkbox" size="25" name="notify_honorifics" id="notify_honorifics" value="1"' . ( ( $wgUser->getIntOption( 'notifyhonorifics', 1 ) == 1 ) ? 'checked' : '' ) . '/>
 625+ <p class="profile-update-row">'
 626+ . wfMsg( 'user-profile-preferences-emails-level' ) .
 627+ ' <input type="checkbox" size="25" name="notify_honorifics" id="notify_honorifics" value="1"' . ( ( $wgUser->getIntOption( 'notifyhonorifics', 1 ) == 1 ) ? 'checked' : '' ) . '/>
628628 </p>';
629629
630630 $form .= '</div>

Status & tagging log