r39289 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39288‎ | r39289 | r39290 >
Date:15:25, 13 August 2008
Author:alnokta
Status:old
Tags:
Comment:
Clean up
Modified paths:
  • /trunk/extensions/NewUserMessage/NewUserMessage.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php
@@ -54,18 +54,18 @@
5555 $dbw->begin();
5656 $good = true;
5757
58 - $signs = wfMsgForContent('newusermessage-signs');
59 - if (!wfEmptyMsg('newusermessage-signs', $signs)) {
60 - $pattern = '/^\* ?(.*?)$/m';
61 - preg_match_all($pattern, $signs, $signsList, PREG_SET_ORDER);
62 - $rand = rand(0, count($signsList)-1);
63 - $sign = $signsList[$rand][1];
 58+ $signatures = wfMsgForContent('newusermessage-signatures');
 59+ if (!wfEmptyMsg('newusermessage-signatures', $signatures)) {
 60+ $pattern = '/^\* ?(.*?)$/m';
 61+ preg_match_all($pattern, $signatures, $signaturesList, PREG_SET_ORDER);
 62+ $rand = rand(0, count($signaturesList)-1);
 63+ $signature = $signaturesList[$rand][1];
6464 }
6565 try {
66 - if (!wfEmptyMsg('newusermessage-signs', $signs)) {
67 - $article->doEdit("{{{$templateTitleText}|$name}}\n--" . $sign . "~~~~~" , wfMsgForContent( 'newuseredit-summary' ), $flags);
 66+ if (!wfEmptyMsg('newusermessage-signatures', $signatures)) {
 67+ $article->doEdit("{{{$templateTitleText}|$name}}\n--" . $signature . "~~~~~" , wfMsgForContent( 'newuseredit-summary' ), $flags);
6868 } else {
69 - $article->doEdit("{{{$templateTitleText}|$name}}", wfMsgForContent( 'newuseredit-summary' ), $flags);
 69+ $article->doEdit("{{{$templateTitleText}|$name}}", wfMsgForContent( 'newuseredit-summary' ), $flags);
7070 }
7171 } catch ( DBQueryError $e ) {
7272 $good = false;

Status & tagging log