r85539 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85538‎ | r85539 | r85540 >
Date:14:22, 6 April 2011
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: in UserProfile:
*check for read-only status before doing any inserts or updates
*use $wgRequest->getInt() instead of $wgRequest->getVal() for getting things that are alway supposed to be integers
*remove some unused (global) variables
*tried to make some insanely long lines a bit shorter
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/SpecialPopulateExistingUsersProfiles.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/SpecialToggleUserPageType.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/SpecialPopulateExistingUsersProfiles.php
@@ -14,7 +14,7 @@
1515 class SpecialPopulateUserProfiles extends SpecialPage {
1616
1717 /**
18 - * Constructor
 18+ * Constructor -- set up the new special page
1919 */
2020 public function __construct() {
2121 parent::__construct( 'PopulateUserProfiles' );
@@ -26,13 +26,26 @@
2727 * @param $params Mixed: parameter(s) passed to the page or null
2828 */
2929 public function execute( $params ) {
30 - global $wgRequest, $wgOut, $wgUser;
 30+ global $wgOut, $wgUser;
3131
 32+ // Check permissions
3233 if ( !in_array( 'staff', $wgUser->getEffectiveGroups() ) ) {
3334 throw new ErrorPageError( 'error', 'badaccess' );
3435 return '';
3536 }
3637
 38+ // Show a message if the database is in read-only mode
 39+ if ( wfReadOnly() ) {
 40+ $wgOut->readOnlyPage();
 41+ return;
 42+ }
 43+
 44+ // If user is blocked, they don't need to access this page
 45+ if ( $wgUser->isBlocked() ) {
 46+ $wgOut->blockedPage();
 47+ return;
 48+ }
 49+
3750 $dbw = wfGetDB( DB_MASTER );
3851 $res = $dbw->select(
3952 'page',
@@ -43,7 +56,7 @@
4457
4558 $count = 0; // To avoid an annoying PHP notice
4659
47 - while ( $row = $dbw->fetchObject( $res ) ) {
 60+ foreach( $res as $row ) {
4861 $user_name_title = Title::newFromDBkey( $row->page_title );
4962 $user_name = $user_name_title->getText();
5063 $user_id = User::idFromName( $user_name );
Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -35,10 +35,8 @@
3636 }
3737
3838 function view() {
39 - global $wgOut, $wgUser, $wgTitle;
 39+ global $wgOut, $wgTitle;
4040
41 - $sk = $wgUser->getSkin();
42 -
4341 $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
4442
4543 // No need to display noarticletext, we use our own message
@@ -138,8 +136,8 @@
139137
140138 if ( $total_value != 0 ) {
141139 $output .= '<div class="user-section-heading">
142 - <div class="user-section-title">'
143 - . wfMsg( 'user-stats-title' ) .
 140+ <div class="user-section-title">' .
 141+ wfMsg( 'user-stats-title' ) .
144142 '</div>
145143 <div class="user-section-actions">
146144 <div class="action-right">
@@ -151,16 +149,39 @@
152150 </div>
153151 <div class="cleared"></div>
154152 <div class="profile-info-container bold-fix">' .
155 - $this->getUserStatsRow( wfMsgExt( 'user-stats-edits', 'parsemag', $stats_data['edits'] ), $stats_data['edits'] ) .
156 - $this->getUserStatsRow( wfMsgExt( 'user-stats-votes', 'parsemag', $stats_data['votes'] ), $stats_data['votes'] ) .
157 - $this->getUserStatsRow( wfMsgExt( 'user-stats-comments', 'parsemag', $stats_data['comments'] ), $stats_data['comments'] ) .
158 - $this->getUserStatsRow( wfMsgExt( 'user-stats-recruits', 'parsemag', $stats_data['recruits'] ), $stats_data['recruits'] ) .
159 - $this->getUserStatsRow( wfMsgExt( 'user-stats-poll-votes', 'parsemag', $stats_data['poll_votes'] ), $stats_data['poll_votes'] ) .
160 - $this->getUserStatsRow( wfMsgExt( 'user-stats-picture-game-votes', 'parsemag', $stats_data['picture_game_votes'] ), $stats_data['picture_game_votes'] ) .
161 - $this->getUserStatsRow( wfMsgExt( 'user-stats-quiz-points', 'parsemag', $stats_data['quiz_points'] ), $stats_data['quiz_points'] );
162 - if ( $stats_data['currency'] != '10,000' ) {
163 - $output .= $this->getUserStatsRow( wfMsgExt( 'user-stats-pick-points', 'parsemag', $stats_data['currency'] ), $stats_data['currency'] );
164 - }
 153+ $this->getUserStatsRow(
 154+ wfMsgExt( 'user-stats-edits', 'parsemag', $stats_data['edits'] ),
 155+ $stats_data['edits']
 156+ ) .
 157+ $this->getUserStatsRow(
 158+ wfMsgExt( 'user-stats-votes', 'parsemag', $stats_data['votes'] ),
 159+ $stats_data['votes']
 160+ ) .
 161+ $this->getUserStatsRow(
 162+ wfMsgExt( 'user-stats-comments', 'parsemag', $stats_data['comments'] ),
 163+ $stats_data['comments'] ) .
 164+ $this->getUserStatsRow(
 165+ wfMsgExt( 'user-stats-recruits', 'parsemag', $stats_data['recruits'] ),
 166+ $stats_data['recruits']
 167+ ) .
 168+ $this->getUserStatsRow(
 169+ wfMsgExt( 'user-stats-poll-votes', 'parsemag', $stats_data['poll_votes'] ),
 170+ $stats_data['poll_votes']
 171+ ) .
 172+ $this->getUserStatsRow(
 173+ wfMsgExt( 'user-stats-picture-game-votes', 'parsemag', $stats_data['picture_game_votes'] ),
 174+ $stats_data['picture_game_votes']
 175+ ) .
 176+ $this->getUserStatsRow(
 177+ wfMsgExt( 'user-stats-quiz-points', 'parsemag', $stats_data['quiz_points'] ),
 178+ $stats_data['quiz_points']
 179+ );
 180+ if ( $stats_data['currency'] != '10,000' ) {
 181+ $output .= $this->getUserStatsRow(
 182+ wfMsgExt( 'user-stats-pick-points', 'parsemag', $stats_data['currency'] ),
 183+ $stats_data['currency']
 184+ );
 185+ }
165186 $output .= '</div>';
166187 }
167188
@@ -268,8 +289,8 @@
269290 $output = '';
270291 if ( $joined_data ) {
271292 $output .= '<div class="user-section-heading">
272 - <div class="user-section-title">'
273 - . wfMsg( 'user-personal-info-title' ) .
 293+ <div class="user-section-title">' .
 294+ wfMsg( 'user-personal-info-title' ) .
274295 '</div>
275296 <div class="user-section-actions">
276297 <div class="action-right">';
@@ -295,21 +316,21 @@
296317 '</div>';
297318 } elseif ( $wgUser->getName() == $user_name ) {
298319 $output .= '<div class="user-section-heading">
299 - <div class="user-section-title">'
300 - . wfMsg( 'user-personal-info-title' ) .
 320+ <div class="user-section-title">' .
 321+ wfMsg( 'user-personal-info-title' ) .
301322 '</div>
302323 <div class="user-section-actions">
303324 <div class="action-right">
304 - <a href="' . $edit_info_link->escapeFullURL() . '">'
305 - . wfMsg( 'user-edit-this' ) .
 325+ <a href="' . $edit_info_link->escapeFullURL() . '">' .
 326+ wfMsg( 'user-edit-this' ) .
306327 '</a>
307328 </div>
308329 <div class="cleared"></div>
309330 </div>
310331 </div>
311332 <div class="cleared"></div>
312 - <div class="no-info-container">'
313 - . wfMsg( 'user-no-personal-info' ) .
 333+ <div class="no-info-container">' .
 334+ wfMsg( 'user-no-personal-info' ) .
314335 '</div>';
315336 }
316337
@@ -343,8 +364,8 @@
344365 $output = '';
345366 if ( $joined_data ) {
346367 $output .= '<div class="user-section-heading">
347 - <div class="user-section-title">'
348 - . wfMsg( 'custom-info-title' ) .
 368+ <div class="user-section-title">' .
 369+ wfMsg( 'custom-info-title' ) .
349370 '</div>
350371 <div class="user-section-actions">
351372 <div class="action-right">';
@@ -365,21 +386,21 @@
366387 '</div>';
367388 } elseif ( $wgUser->getName() == $user_name ) {
368389 $output .= '<div class="user-section-heading">
369 - <div class="user-section-title">'
370 - . wfMsg( 'custom-info-title' ) .
 390+ <div class="user-section-title">' .
 391+ wfMsg( 'custom-info-title' ) .
371392 '</div>
372393 <div class="user-section-actions">
373394 <div class="action-right">
374 - <a href="' . $edit_info_link->escapeFullURL() . '/custom">'
375 - . wfMsg( 'user-edit-this' ) .
 395+ <a href="' . $edit_info_link->escapeFullURL() . '/custom">' .
 396+ wfMsg( 'user-edit-this' ) .
376397 '</a>
377398 </div>
378399 <div class="cleared"></div>
379400 </div>
380401 </div>
381402 <div class="cleared"></div>
382 - <div class="no-info-container">'
383 - . wfMsg( 'custom-no-info' ) .
 403+ <div class="no-info-container">' .
 404+ wfMsg( 'custom-no-info' ) .
384405 '</div>';
385406 }
386407
@@ -416,8 +437,8 @@
417438 $output = '';
418439 if ( $joined_data ) {
419440 $output .= '<div class="user-section-heading">
420 - <div class="user-section-title">'
421 - . wfMsg( 'other-info-title' ) .
 441+ <div class="user-section-title">' .
 442+ wfMsg( 'other-info-title' ) .
422443 '</div>
423444 <div class="user-section-actions">
424445 <div class="action-right">';
@@ -442,19 +463,21 @@
443464 '</div>';
444465 } elseif ( $wgUser->getName() == $user_name ) {
445466 $output .= '<div class="user-section-heading">
446 - <div class="user-section-title">'
447 - . wfMsg( 'other-info-title' ) .
 467+ <div class="user-section-title">' .
 468+ wfMsg( 'other-info-title' ) .
448469 '</div>
449470 <div class="user-section-actions">
450471 <div class="action-right">
451 - <a href="' . $edit_info_link->escapeFullURL() . '/personal">' . wfMsg( 'user-edit-this' ) . '</a>
 472+ <a href="' . $edit_info_link->escapeFullURL() . '/personal">' .
 473+ wfMsg( 'user-edit-this' ) .
 474+ '</a>
452475 </div>
453476 <div class="cleared"></div>
454477 </div>
455478 </div>
456479 <div class="cleared"></div>
457 - <div class="no-info-container">'
458 - . wfMsg( 'other-no-info' ) .
 480+ <div class="no-info-container">' .
 481+ wfMsg( 'other-no-info' ) .
459482 '</div>';
460483 }
461484 return $output;
@@ -526,7 +549,8 @@
527550 }
528551
529552 $output .= '<div id="profile-image">
530 - <img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />
 553+ <img src="' . $wgUploadPath . '/avatars/' .
 554+ $avatar->getAvatarImage() . '" alt="" border="0" />
531555 </div>';
532556
533557 $output .= '<div id="profile-right">';
@@ -580,10 +604,12 @@
581605
582606 global $wgUserBoard;
583607 if ( $wgUserBoard ) {
584 - $output .= '<a href="' . $send_message->escapeFullURL( 'user=' . $wgUser->getName() . '&conv=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-send-message' ) . '</a>';
 608+ $output .= '<a href="' . $send_message->escapeFullURL( 'user=' . $wgUser->getName() . '&conv=' . $user_safe ) . '" rel="nofollow">' .
 609+ wfMsg( 'user-send-message' ) . '</a>';
585610 $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
586611 }
587 - $output .= '<a href="' . $give_gift->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-send-gift' ) . '</a>';
 612+ $output .= '<a href="' . $give_gift->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' .
 613+ wfMsg( 'user-send-gift' ) . '</a>';
588614 $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
589615 }
590616
@@ -591,16 +617,19 @@
592618
593619 // Links to User:user_name from User_profile:
594620 if ( $wgTitle->getNamespace() == NS_USER_PROFILE && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0 ) {
595 - $output .= '| <a href="' . $user_page->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-page-link' ) . '</a> ';
 621+ $output .= '| <a href="' . $user_page->escapeFullURL() . '" rel="nofollow">' .
 622+ wfMsg( 'user-page-link' ) . '</a> ';
596623 }
597624
598625 // Links to User:user_name from User_profile:
599626 if ( $wgTitle->getNamespace() == NS_USER && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0 ) {
600 - $output .= '| <a href="' . $user_social_profile->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-social-profile-link' ) . '</a> ';
 627+ $output .= '| <a href="' . $user_social_profile->escapeFullURL() . '" rel="nofollow">' .
 628+ wfMsg( 'user-social-profile-link' ) . '</a> ';
601629 }
602630
603631 if ( $wgTitle->getNamespace() == NS_USER && ( !$this->profile_data['user_id'] || $this->profile_data['user_page_type'] == 1 ) ) {
604 - $output .= '| <a href="' . $user_wiki->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-wiki-link' ) . '</a>';
 632+ $output .= '| <a href="' . $user_wiki->escapeFullURL() . '" rel="nofollow">' .
 633+ wfMsg( 'user-wiki-link' ) . '</a>';
605634 }
606635
607636 $output .= '</div>
@@ -610,6 +639,13 @@
611640 return $output;
612641 }
613642
 643+ /**
 644+ * This is currently unused, seems to be a leftover from the ArmchairGM
 645+ * days.
 646+ *
 647+ * @param $user_name String: user name
 648+ * @return String: HTML
 649+ */
614650 function getProfileImage( $user_name ) {
615651 global $wgUser, $wgUploadPath;
616652
@@ -716,7 +752,8 @@
717753 foreach ( $friends as $friend ) {
718754 $user = Title::makeTitle( NS_USER, $friend['user_name'] );
719755 $avatar = new wAvatar( $friend['user_id'], 'ml' );
720 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 756+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 757+ $avatar->getAvatarImage() . '" alt="" border="0" />';
721758
722759 // Chop down username that gets displayed
723760 $user_name = mb_substr( $friend['user_name'], 0, 9 );
@@ -769,8 +806,8 @@
770807
771808 if ( $activity ) {
772809 $output .= '<div class="user-section-heading">
773 - <div class="user-section-title">'
774 - . wfMsg( 'user-recent-activity-title' ) .
 810+ <div class="user-section-title">' .
 811+ wfMsg( 'user-recent-activity-title' ) .
775812 '</div>
776813 <div class="user-section-actions">
777814 <div class="action-right">
@@ -842,7 +879,7 @@
843880 case 'gift-sent':
844881 $gift_image = "<img src=\"{$wgUploadPath}/awards/" .
845882 Gifts::getGiftImage( $item['namespace'], 'm' ) .
846 - "\" border=\"0\" alt=\"\" />";
 883+ '" border="0" alt="" />';
847884 $item_html .= wfMsg( 'user-recent-activity-gift-sent' ) . " {$user_link_2} {$item_time}
848885 <div class=\"item\">
849886 <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewGift&gift_id={$item['id']}\" rel=\"nofollow\">
@@ -854,7 +891,7 @@
855892 case 'gift-rec':
856893 $gift_image = "<img src=\"{$wgUploadPath}/awards/" .
857894 Gifts::getGiftImage( $item['namespace'], 'm' ) .
858 - "\" border=\"0\" alt=\"\" />";
 895+ '" border="0" alt="" />';
859896 $item_html .= wfMsg( 'user-recent-activity-gift-rec' ) . " {$user_link_2} {$item_time}</span>
860897 <div class=\"item\">
861898 <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewGift&gift_id={$item['id']}\" rel=\"nofollow\">
@@ -866,7 +903,7 @@
867904 case 'system_gift':
868905 $gift_image = "<img src=\"{$wgUploadPath}/awards/" .
869906 SystemGifts::getGiftImage( $item['namespace'], 'm' ) .
870 - "\" border=\"0\" alt=\"\" />";
 907+ '" border="0" alt="" />';
871908 $item_html .= wfMsg( 'user-recent-system-gift' ) . " {$item_time}
872909 <div class=\"user-home-item-gift\">
873910 <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewSystemGift&gift_id={$item['id']}\" rel=\"nofollow\">
@@ -876,10 +913,12 @@
877914 </div>";
878915 break;
879916 case 'friend':
880 - $item_html .= wfMsg( 'user-recent-activity-friend' ) . " <b>{$user_link_2}</b> {$item_time}";
 917+ $item_html .= wfMsg( 'user-recent-activity-friend' ) .
 918+ " <b>{$user_link_2}</b> {$item_time}";
881919 break;
882920 case 'foe':
883 - $item_html .= wfMsg( 'user-recent-activity-foe' ) . " <b>{$user_link_2}</b> {$item_time}";
 921+ $item_html .= wfMsg( 'user-recent-activity-foe' ) .
 922+ " <b>{$user_link_2}</b> {$item_time}";
884923 break;
885924 case 'system_message':
886925 $item_html .= "{$item['comment']} {$item_time}";
@@ -1093,8 +1132,8 @@
10941133 $x = 1;
10951134
10961135 $output .= '<div class="user-section-heading">
1097 - <div class="user-section-title">'
1098 - . wfMsg( 'user-awards-title' ) .
 1136+ <div class="user-section-title">' .
 1137+ wfMsg( 'user-awards-title' ) .
10991138 '</div>
11001139 <div class="user-section-actions">
11011140 <div class="action-right">';
@@ -1188,8 +1227,8 @@
11891228 }
11901229
11911230 $output .= '<div class="user-section-heading">
1192 - <div class="user-section-title">'
1193 - . wfMsg( 'user-board-title' ) .
 1231+ <div class="user-section-title">' .
 1232+ wfMsg( 'user-board-title' ) .
11941233 '</div>
11951234 <div class="user-section-actions">
11961235 <div class="action-right">';
@@ -1223,10 +1262,16 @@
12241263 if ( $wgUser->isLoggedIn() && !$wgUser->isBlocked() ) {
12251264 $output .= '<div class="user-page-message-form">
12261265 <input type="hidden" id="user_name_to" name="user_name_to" value="' . addslashes( $user_name ) . '" />
1227 - <span style="color:#797979;">' . wfMsgHtml( 'userboard_messagetype' ) . '</span>
 1266+ <span style="color:#797979;">' .
 1267+ wfMsgHtml( 'userboard_messagetype' ) .
 1268+ '</span>
12281269 <select id="message_type">
1229 - <option value="0">' . wfMsgHtml( 'userboard_public' ) . '</option>
1230 - <option value="1">' . wfMsgHtml( 'userboard_private' ) . '</option>
 1270+ <option value="0">' .
 1271+ wfMsgHtml( 'userboard_public' ) .
 1272+ '</option>
 1273+ <option value="1">' .
 1274+ wfMsgHtml( 'userboard_private' ) .
 1275+ '</option>
12311276 </select><p>
12321277 <textarea name="message" id="message" cols="43" rows="4"/></textarea>
12331278 <div class="user-page-message-box-button">
@@ -1235,8 +1280,8 @@
12361281 </div>';
12371282 } else {
12381283 $login_link = SpecialPage::getTitleFor( 'Userlogin' );
1239 - $output .= '<div class="user-page-message-form">'
1240 - . wfMsg( 'user-board-login-message', $login_link->escapeFullURL() ) .
 1284+ $output .= '<div class="user-page-message-form">' .
 1285+ wfMsg( 'user-board-login-message', $login_link->escapeFullURL() ) .
12411286 '</div>';
12421287 }
12431288 }
@@ -1244,7 +1289,6 @@
12451290 $output .= '<div id="user-page-board">';
12461291 $b = new UserBoard();
12471292 $output .= $b->displayMessages( $user_id, 0, 10 );
1248 -
12491293 $output .= '</div>';
12501294
12511295 return $output;
Index: trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php
@@ -56,7 +56,7 @@
5757
5858 // If the request was POSTed, then delete the avatar
5959 if ( $wgRequest->wasPosted() ) {
60 - $user_id = $wgRequest->getVal( 'user_id' );
 60+ $user_id = $wgRequest->getInt( 'user_id' );
6161 $user_deleted = User::newFromId( $user_id );
6262 $user_deleted->loadFromDatabase();
6363
@@ -74,8 +74,13 @@
7575 $wgUser->getUserPage(),
7676 wfMsg( 'user-profile-picture-log-delete-entry', $user_deleted->getName() )
7777 );
78 - $wgOut->addHTML( '<div>' . wfMsg( 'avatarupload-removesuccess' ) . '</div>' );
79 - $wgOut->addHTML( '<div><a href="' . $this->title->escapeFullURL() . '">' . wfMsg( 'avatarupload-removeanother' ) . '</a></div>' );
 78+ $wgOut->addHTML(
 79+ '<div>' . wfMsg( 'avatarupload-removesuccess' ) . '</div>'
 80+ );
 81+ $wgOut->addHTML(
 82+ '<div><a href="' . $this->title->escapeFullURL() . '">' .
 83+ wfMsg( 'avatarupload-removeanother' ) . '</a></div>'
 84+ );
8085 } else {
8186 if ( $user ) {
8287 $wgOut->addHTML( $this->showUserAvatar( $user ) );
@@ -129,6 +134,7 @@
130135 */
131136 private function deleteImage( $id, $size ) {
132137 global $wgUploadDirectory, $wgDBname, $wgMemc;
 138+
133139 $avatar = new wAvatar( $id, $size );
134140 $files = glob( $wgUploadDirectory . '/avatars/' . $wgDBname . '_' . $id . '_' . $size . "*" );
135141 wfSuppressWarnings();
Index: trunk/extensions/SocialProfile/UserProfile/SpecialToggleUserPageType.php
@@ -13,7 +13,7 @@
1414 class SpecialToggleUserPage extends UnlistedSpecialPage {
1515
1616 /**
17 - * Constructor
 17+ * Constructor -- set up the new special page
1818 */
1919 public function __construct() {
2020 parent::__construct( 'ToggleUserPage' );
@@ -25,15 +25,26 @@
2626 * @param $params Mixed: parameter(s) passed to the page or null
2727 */
2828 public function execute( $params ) {
29 - global $wgRequest, $wgOut, $wgUser, $wgMemc;
 29+ global $wgOut, $wgUser, $wgMemc;
3030
3131 // This feature is only available to logged-in users.
3232 if ( !$wgUser->isLoggedIn() ) {
3333 throw new ErrorPageError( 'error', 'badaccess' );
3434 }
3535
 36+ // Show a message if the database is in read-only mode
 37+ if ( wfReadOnly() ) {
 38+ $wgOut->readOnlyPage();
 39+ return;
 40+ }
 41+
3642 $dbr = wfGetDB( DB_MASTER );
37 - $s = $dbr->selectRow( 'user_profile', array( 'up_user_id' ), array( 'up_user_id' => $wgUser->getID() ), __METHOD__ );
 43+ $s = $dbr->selectRow(
 44+ 'user_profile',
 45+ array( 'up_user_id' ),
 46+ array( 'up_user_id' => $wgUser->getID() ),
 47+ __METHOD__
 48+ );
3849 if ( $s === false ) {
3950 $dbw = wfGetDB( DB_MASTER );
4051 $dbw->insert( 'user_profile',

Status & tagging log