r98762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98761‎ | r98762 | r98763 >
Date:13:56, 3 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/api (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)
  • /branches/REL1_18/phase3/includes/parser/Parser.php (modified) (history)
  • /branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialBlock.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialBlockList.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /branches/REL1_18/phase3/includes/templates/Userlogin.php (modified) (history)
  • /branches/REL1_18/phase3/languages/messages (modified) (history)
  • /branches/REL1_18/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/dumpTextPass.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /branches/REL1_18/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -212,6 +212,9 @@
213213 User:getDefaultOptions().
214214 * (bug 30722) Add an identity collation that sorts things based on what the
215215 unicode code point is (aka pre-1.17 behaviour)
 216+* (bug 31293) If Special:Userlogin is loaded over HTTPS, display
 217+ MediaWiki:loginend-https instead of MediaWiki:loginend, if it's not empty.
 218+ Same for signupend on the account creation page.
216219
217220 === Bug fixes in 1.18 ===
218221 * mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php)
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
219222 Merged /trunk/phase3/RELEASE-NOTES-1.18:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
Index: branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php
@@ -786,4 +786,65 @@
787787 return $retval = $wgRequest->getFuzzyBool( 'debug',
788788 $wgRequest->getCookie( 'resourceLoaderDebug', '', $wgResourceLoaderDebug ) );
789789 }
 790+
 791+ /**
 792+ * Build a load.php URL
 793+ * @param $modules array of module names (strings)
 794+ * @param $lang string Language code
 795+ * @param $skin string Skin name
 796+ * @param $user string|null User name. If null, the &user= parameter is omitted
 797+ * @param $version string|null Versioning timestamp
 798+ * @param $debug bool Whether the request should be in debug mode
 799+ * @param $only string|null &only= parameter
 800+ * @param $printable bool Printable mode
 801+ * @param $handheld bool Handheld mode
 802+ * @param $extraQuery array Extra query parameters to add
 803+ * @return string URL to load.php. May be protocol-relative (if $wgLoadScript is procol-relative)
 804+ */
 805+ public static function makeLoaderURL( $modules, $lang, $skin, $user = null, $version = null, $debug = false, $only = null,
 806+ $printable = false, $handheld = false, $extraQuery = array() ) {
 807+ global $wgLoadScript;
 808+ $query = self::makeLoaderQuery( $modules, $lang, $skin, $user, $version, $debug,
 809+ $only, $printable, $handheld, $extraQuery
 810+ );
 811+
 812+ // Prevent the IE6 extension check from being triggered (bug 28840)
 813+ // by appending a character that's invalid in Windows extensions ('*')
 814+ return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ) . '&*', PROTO_RELATIVE );
 815+ }
 816+
 817+ /**
 818+ * Build a query array (array representation of query string) for load.php. Helper
 819+ * function for makeLoaderURL().
 820+ * @return array
 821+ */
 822+ public static function makeLoaderQuery( $modules, $lang, $skin, $user = null, $version = null, $debug = false, $only = null,
 823+ $printable = false, $handheld = false, $extraQuery = array() ) {
 824+ $query = array(
 825+ 'modules' => self::makePackedModulesString( $modules ),
 826+ 'lang' => $lang,
 827+ 'skin' => $skin,
 828+ 'debug' => $debug ? 'true' : 'false',
 829+ );
 830+ if ( $user !== null ) {
 831+ $query['user'] = $user;
 832+ }
 833+ if ( $version !== null ) {
 834+ $query['version'] = $version;
 835+ }
 836+ if ( $only !== null ) {
 837+ $query['only'] = $only;
 838+ }
 839+ if ( $printable ) {
 840+ $query['printable'] = 1;
 841+ }
 842+ if ( $handheld ) {
 843+ $query['handheld'] = 1;
 844+ }
 845+ $query += $extraQuery;
 846+
 847+ // Make queries uniform in order
 848+ ksort( $query );
 849+ return $query;
 850+ }
790851 }
Property changes on: branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
791852 Merged /trunk/phase3/includes/resourceloader/ResourceLoader.php:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
Index: branches/REL1_18/phase3/includes/parser/Parser.php
@@ -2735,10 +2735,8 @@
27362736 case 'server':
27372737 return $wgServer;
27382738 case 'servername':
2739 - wfSuppressWarnings(); # May give an E_WARNING in PHP < 5.3.3
2740 - $serverName = parse_url( $wgServer, PHP_URL_HOST );
2741 - wfRestoreWarnings();
2742 - return $serverName ? $serverName : $wgServer;
 2739+ $serverParts = wfParseUrl( $wgServer );
 2740+ return $serverParts && isset( $serverParts['host'] ) ? $serverParts['host'] : $wgServer;
27432741 case 'scriptpath':
27442742 return $wgScriptPath;
27452743 case 'stylepath':
Index: branches/REL1_18/phase3/includes/templates/Userlogin.php
@@ -152,7 +152,7 @@
153153 <?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
154154 </form>
155155 </div>
156 -<div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
 156+<div id="loginend"><?php $this->html( 'loginend' ); ?></div>
157157 <?php
158158
159159 }
@@ -377,7 +377,7 @@
378378 <?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
379379 </form>
380380 </div>
381 -<div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>
 381+<div id="signupend"><?php $this->html( 'signupend' ); ?></div>
382382 <?php
383383
384384 }
Index: branches/REL1_18/phase3/includes/specials/SpecialBlock.php
@@ -92,7 +92,11 @@
9393 $wgOut->setPageTitle( wfMsg( 'blockip-title' ) );
9494 $wgOut->addModules( 'mediawiki.special', 'mediawiki.special.block' );
9595
96 - $fields = self::getFormFields();
 96+ $out = $this->getOutput();
 97+ $out->setPageTitle( wfMsg( 'blockip-title' ) );
 98+ $out->addModules( array( 'mediawiki.special', 'mediawiki.special.block' ) );
 99+
 100+ $fields = $this->getFormFields();
97101 $this->maybeAlterFormDefaults( $fields );
98102
99103 $form = new HTMLForm( $fields, $this->getContext() );
Property changes on: branches/REL1_18/phase3/includes/specials/SpecialBlock.php
___________________________________________________________________
Modified: svn:mergeinfo
100104 Merged /trunk/phase3/includes/specials/SpecialBlock.php:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
Index: branches/REL1_18/phase3/includes/specials/SpecialBlockList.php
@@ -317,7 +317,7 @@
318318 if ( $row->ipb_create_account ) {
319319 $properties[] = $msg['createaccountblock'];
320320 }
321 - if ( !$row->ipb_enable_autoblock ) {
 321+ if ( $row->ipb_user && !$row->ipb_enable_autoblock ) {
322322 $properties[] = $msg['noautoblockblock'];
323323 }
324324
@@ -346,6 +346,7 @@
347347 'fields' => array(
348348 'ipb_id',
349349 'ipb_address',
 350+ 'ipb_user',
350351 'ipb_by',
351352 'ipb_reason',
352353 'ipb_timestamp',
Index: branches/REL1_18/phase3/includes/specials/SpecialUserlogin.php
@@ -564,6 +564,10 @@
565565 } else {
566566 $wgAuth->updateUser( $u );
567567 $wgUser = $u;
 568+ // This should set it for OutputPage and the Skin
 569+ // which is needed or the personal links will be
 570+ // wrong.
 571+ RequestContext::getMain()->setUser( $u );
568572
569573 // Please reset throttle for successful logins, thanks!
570574 if ( $throttleCount ) {
@@ -1030,6 +1034,22 @@
10311035 if( $this->mLanguage )
10321036 $template->set( 'uselang', $this->mLanguage );
10331037 }
 1038+
 1039+ // Use loginend-https for HTTPS requests if it's not blank, loginend otherwise
 1040+ // Ditto for signupend
 1041+ $usingHTTPS = WebRequest::detectProtocol();
 1042+ $loginendHTTPS = wfMessage( 'loginend-https' );
 1043+ $signupendHTTPS = wfMessage( 'signupend-https' );
 1044+ if ( $usingHTTPS && !$loginendHTTPS->isBlank() ) {
 1045+ $template->set( 'loginend', $loginendHTTPS->parse() );
 1046+ } else {
 1047+ $template->set( 'loginend', wfMessage( 'loginend' )->parse() );
 1048+ }
 1049+ if ( $usingHTTPS && !$signupendHTTPS->isBlank() ) {
 1050+ $template->set( 'signupend', $signupendHTTPS->parse() );
 1051+ } else {
 1052+ $template->set( 'signupend', wfMessage( 'signupend' )->parse() );
 1053+ }
10341054
10351055 // Give authentication and captcha plugins a chance to modify the form
10361056 $wgAuth->modifyUITemplate( $template, $this->mType );
Property changes on: branches/REL1_18/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
10371057 Merged /trunk/phase3/includes/specials:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
Index: branches/REL1_18/phase3/includes/api/ApiQuerySiteinfo.php
@@ -284,12 +284,12 @@
285285 if ( isset( $langNames[$row->iw_prefix] ) ) {
286286 $val['language'] = $langNames[$row->iw_prefix];
287287 }
288 - $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT );
289 - if( isset( $row['iw_wikiid'] ) ) {
290 - $val['wikiid'] = $row['iw_wikiid'];
 288+ $val['url'] = wfExpandUrl( $row->iw_url, PROTO_CURRENT );
 289+ if( isset( $row->iw_wikiid ) ) {
 290+ $val['wikiid'] = $row->iw_wikiid;
291291 }
292 - if( isset( $row['iw_api'] ) ) {
293 - $val['api'] = $row['iw_api'];
 292+ if( isset( $row->iw_api ) ) {
 293+ $val['api'] = $row->iw_api;
294294 }
295295
296296 $data[] = $val;
Property changes on: branches/REL1_18/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
297297 Merged /trunk/phase3/includes/api:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
298298 Merged /branches/wmf/1.18wmf1/includes/api:r97789
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
299299 Merged /trunk/phase3/includes:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
Index: branches/REL1_18/phase3/languages/messages/MessagesEn.php
@@ -1111,8 +1111,10 @@
11121112 To prevent abuse, only one password reminder will be sent per {{PLURAL:$1|hour|$1 hours}}.',
11131113 'loginstart' => '', # do not translate or duplicate this message to other languages
11141114 'loginend' => '', # do not translate or duplicate this message to other languages
 1115+'loginend-https' => '', # do not translate or duplicate this message to other languages
11151116 'signupstart' => '{{int:loginstart}}', # do not translate or duplicate this message to other languages
11161117 'signupend' => '{{int:loginend}}', # do not translate or duplicate this message to other languages
 1118+'signupend-https' => '', # do not translate or duplicate this message to other languages
11171119 'mailerror' => 'Error sending mail: $1',
11181120 'acct_creation_throttle_hit' => 'Visitors to this wiki using your IP address have created {{PLURAL:$1|1 account|$1 accounts}} in the last day, which is the maximum allowed in this time period.
11191121 As a result, visitors using this IP address cannot create any more accounts at the moment.',
Property changes on: branches/REL1_18/phase3/languages/messages
___________________________________________________________________
Modified: svn:mergeinfo
11201122 Merged /trunk/phase3/languages/messages:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720
Index: branches/REL1_18/phase3/maintenance/language/messages.inc
@@ -469,8 +469,10 @@
470470 'throttled-mailpassword',
471471 'loginstart',
472472 'loginend',
 473+ 'loginend-https',
473474 'signupstart',
474475 'signupend',
 476+ 'signupend-https',
475477 'mailerror',
476478 'acct_creation_throttle_hit',
477479 'emailauthenticated',
Index: branches/REL1_18/phase3/maintenance/language/messageTypes.inc
@@ -105,6 +105,7 @@
106106 'history_copyright',
107107 'licenses',
108108 'loginstart',
 109+ 'loginend-https',
109110 'loginend',
110111 'loginlanguagelinks',
111112 'pear-mail-error',
@@ -128,6 +129,7 @@
129130 'signature-anon',
130131 'signupstart',
131132 'signupend',
 133+ 'signupend-https',
132134 'sitenotice',
133135 'sitesubtitle',
134136 'sitetitle',
Index: branches/REL1_18/phase3/maintenance/dumpTextPass.php
@@ -422,12 +422,23 @@
423423 function openSpawn() {
424424 global $IP;
425425
426 - $cmd = implode( " ",
427 - array_map( 'wfEscapeShellArg',
428 - array(
429 - $this->php,
430 - "$IP/maintenance/fetchText.php",
431 - '--wiki', wfWikiID() ) ) );
 426+ if ( file_exists( "$IP/../multiversion/MWScript.php" ) ) {
 427+ $cmd = implode( " ",
 428+ array_map( 'wfEscapeShellArg',
 429+ array(
 430+ $this->php,
 431+ "$IP/../multiversion/MWScript.php",
 432+ "fetchText.php",
 433+ '--wiki', wfWikiID() ) ) );
 434+ }
 435+ else {
 436+ $cmd = implode( " ",
 437+ array_map( 'wfEscapeShellArg',
 438+ array(
 439+ $this->php,
 440+ "$IP/maintenance/fetchText.php",
 441+ '--wiki', wfWikiID() ) ) );
 442+ }
432443 $spec = array(
433444 0 => array( "pipe", "r" ),
434445 1 => array( "pipe", "w" ),
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
435446 Merged /trunk/phase3:r97806,97895,98193-98194,98237,98502,98610,98656,98707,98713,98716,98718-98720

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97806Merge r97789 into trunk...reedy11:04, 22 September 2011
r97895add mwscript handling for call of fetchText.php maintenance scriptariel07:48, 23 September 2011
r98193(bug 31176) {{SERVERNAME}} doesn't play nice with protocol-relative URLscatrope23:14, 26 September 2011
r98194Fix stupid typo in r98193, thanks Dantmancatrope23:16, 26 September 2011
r98237(bug 31191) Followup to r90934: do this in the successful login code path too...catrope19:21, 27 September 2011
r98502Address fixme on r96978: expand URLs fed to the client-side loadercatrope10:14, 30 September 2011
r98656Don't show 'autoblock disabled' for IP blocksaaron06:10, 2 October 2011
r98707(bug 31293) If Special:Userlogin is loaded over HTTPS, display MediaWiki:logi...catrope20:02, 2 October 2011
r98713Followup r98707: Register new message key and set it to ignore for translatew...raymond20:44, 2 October 2011
r98716Followup r98707, r98713: check for blankness, not nonexistence. Since r98713 ...catrope20:58, 2 October 2011
r98718Followup r98707: apply this logic to signupend too, per a bug comment.catrope21:07, 2 October 2011
r98719Followup r98718: Register new message key with content per chat with Roan and...raymond21:18, 2 October 2011
r98720Fix r98719: in hindsight, this message should be empty by default. Raymond as...catrope21:42, 2 October 2011

Status & tagging log