r93426 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93425‎ | r93426 | r93427 >
Date:20:20, 28 July 2011
Author:hashar
Status:ok
Tags:
Comment:
MFT to REL1_18
r92634: typo in previous commit (fix r89029)
r92762: API must respect disabled query pages (fix r78824)
r92791: SpecialChangePassword used wrong message
r93141: mw.loader.load relative-protocol URLs support
r93303: typo for message autoblockedtext
HetWrapper:
r92854: Maintenance redefined TESTWIKI constant
r92958: Maitenance::shouldExecute() now allow multiple requires()
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/Exception.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryQueryPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/media/SVGMetadataExtractor.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialChangePassword.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/Maintenance.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/cleanupTable.inc (modified) (history)
  • /branches/REL1_18/phase3/maintenance/tables.sql (modified) (history)
  • /branches/REL1_18/phase3/resources/mediawiki/mediawiki.js (modified) (history)
  • /branches/REL1_18/phase3/tests/phpunit/includes/media/SVGMetadataExtractorTest.php (modified) (history)
  • /branches/REL1_18/phase3/tests/selenium/installer/README.txt (modified) (history)
  • /branches/REL1_18/phase3/tests/testHelpers.inc (modified) (history)

Diff [purge]

Property changes on: branches/REL1_18/phase3/maintenance/cleanupTable.inc
___________________________________________________________________
Modified: svn:mergeinfo
11 Merged /trunk/phase3/maintenance/cleanupTable.inc:r92634,92762,92791,92854,92958,93141,93303
Index: branches/REL1_18/phase3/maintenance/Maintenance.php
@@ -133,18 +133,25 @@
134134 /**
135135 * Should we execute the maintenance script, or just allow it to be included
136136 * as a standalone class? It checks that the call stack only includes this
137 - * function and a require (meaning was called from the file scope)
 137+ * function and "requires" (meaning was called from the file scope)
138138 *
139139 * @return Boolean
140140 */
141141 public static function shouldExecute() {
142142 $bt = debug_backtrace();
143 - if( count( $bt ) !== 2 ) {
144 - return false;
 143+ if ( count( $bt ) < 2 ) {
 144+ return false; // sanity
145145 }
146 - return in_array( $bt[1]['function'], array( 'require_once', 'require', 'include' ) ) &&
147 - $bt[0]['class'] == 'Maintenance' &&
148 - $bt[0]['function'] == 'shouldExecute';
 146+ if ( $bt[0]['class'] !== 'Maintenance' || $bt[0]['function'] !== 'shouldExecute' ) {
 147+ return false; // last call should be to this function
 148+ }
 149+ $includeFuncs = array( 'require_once', 'require', 'include' );
 150+ for( $i=1; $i < count( $bt ); $i++ ) {
 151+ if ( !in_array( $bt[$i]['function'], $includeFuncs ) ) {
 152+ return false; // previous calls should all be "requires"
 153+ }
 154+ }
 155+ return true;
149156 }
150157
151158 /**
@@ -926,7 +933,9 @@
927934 ini_set( 'include_path', ".:$IP:$IP/includes:$IP/languages:$IP/maintenance" );
928935
929936 if ( $lang == 'test' && $site == 'wikipedia' ) {
930 - define( 'TESTWIKI', 1 );
 937+ if ( !defined( 'TESTWIKI' ) ) {
 938+ define( 'TESTWIKI', 1 );
 939+ }
931940 }
932941 }
933942
@@ -1254,4 +1263,3 @@
12551264 return;
12561265 }
12571266 }
1258 -
Property changes on: branches/REL1_18/phase3/maintenance/tables.sql
___________________________________________________________________
Modified: svn:mergeinfo
12591267 Merged /trunk/phase3/maintenance/tables.sql:r92634,92762,92791,92854,92958,93141,93303
Property changes on: branches/REL1_18/phase3/tests/selenium/installer/README.txt
___________________________________________________________________
Modified: svn:mergeinfo
12601268 Merged /trunk/phase3/tests/selenium/installer/README.txt:r92634,92762,92791,92854,92958,93141,93303
Index: branches/REL1_18/phase3/tests/phpunit/includes/media/SVGMetadataExtractorTest.php
@@ -18,7 +18,7 @@
1919 */
2020 function testGetXMLMetadata( $infile, $expected ) {
2121 $r = new XMLReader();
22 - if( !method_exists( $r, 'readInnerXML()' ) ) {
 22+ if( !method_exists( $r, 'readInnerXML' ) ) {
2323 $this->markTestSkipped( 'XMLReader::readInnerXML() does not exist (libxml >2.6.20 needed).' );
2424 return;
2525 }
Property changes on: branches/REL1_18/phase3/tests/testHelpers.inc
___________________________________________________________________
Modified: svn:mergeinfo
2626 Merged /trunk/phase3/tests/testHelpers.inc:r92634,92762,92791,92854,92958,93141,93303
Index: branches/REL1_18/phase3/includes/api/ApiQueryQueryPage.php
@@ -98,6 +98,11 @@
9999 }
100100 }
101101 $result->addValue( array( 'query' ), $this->getModuleName(), $r );
 102+
 103+ if ( $qp->isCached() && !$qp->isCacheable() ) {
 104+ // Disabled query page, don't run the query
 105+ return;
 106+ }
102107
103108 $res = $qp->doQuery( $params['limit'] + 1, $params['offset'] );
104109 $count = 0;
Property changes on: branches/REL1_18/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
105110 Merged /trunk/phase3/includes/api:r92634,92762,92791,92854,92958,93141,93303
Index: branches/REL1_18/phase3/includes/media/SVGMetadataExtractor.php
@@ -177,7 +177,7 @@
178178 return;
179179 }
180180 // TODO: find and store type of xml snippet. metadata['metadataType'] = "rdf"
181 - if( method_exists( $this->reader, 'readInnerXML()' ) ) {
 181+ if( method_exists( $this->reader, 'readInnerXML' ) ) {
182182 $this->metadata[$metafield] = trim( $this->reader->readInnerXML() );
183183 } else {
184184 throw new MWException( "The PHP XMLReader extension does not come with readInnerXML() method. Your libxml is probably out of date (need 2.6.20 or later)." );
Index: branches/REL1_18/phase3/includes/specials/SpecialChangePassword.php
@@ -207,7 +207,7 @@
208208 protected function attemptReset( $newpass, $retype ) {
209209 $user = User::newFromName( $this->mUserName );
210210 if( !$user || $user->isAnon() ) {
211 - throw new PasswordError( 'no such user' );
 211+ throw new PasswordError( wfMsg( 'nosuchusershort', $this->mUserName ) );
212212 }
213213
214214 if( $newpass !== $retype ) {
Property changes on: branches/REL1_18/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
215215 Merged /trunk/phase3/includes/specials:r92634,92762,92791,92854,92958,93141,93303
Index: branches/REL1_18/phase3/includes/Exception.php
@@ -368,7 +368,7 @@
369369
370370 parent::__construct(
371371 'blockedtitle',
372 - $block->mAuto ? 'autoblocketext' : 'blockedtext',
 372+ $block->mAuto ? 'autoblockedtext' : 'blockedtext',
373373 array(
374374 $link,
375375 $reason,
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
376376 Merged /trunk/phase3/includes:r92634,92762,92791,92854,92958,93141,93303
Index: branches/REL1_18/phase3/resources/mediawiki/mediawiki.js
@@ -972,7 +972,7 @@
973973 // Allow calling with an external script or single dependency as a string
974974 if ( typeof modules === 'string' ) {
975975 // Support adding arbitrary external scripts
976 - if ( modules.substr( 0, 7 ) == 'http://' || modules.substr( 0, 8 ) == 'https://' ) {
 976+ if ( modules.substr( 0, 7 ) === 'http://' || modules.substr( 0, 8 ) === 'https://' || modules.substr( 0, 2 ) === '//' ) {
977977 if ( type === 'text/css' ) {
978978 $( 'head' ).append( $( '<link />', {
979979 rel: 'stylesheet',
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
980980 Merged /trunk/phase3:r92634,92762,92791,92854,92958,93141,93303

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78824(bug 14869) Add API module for accessing QueryPage-based special pages. Took ...catrope20:35, 22 December 2010
r89029Handle old libxml when extracting SVG metadata...hashar09:58, 28 May 2011
r92634Fixup r89029. You don't include the brackets in the method name!...platonides15:13, 20 July 2011
r92762Fix r78824 after some misunderstandings in the CR comments. The querypage API...catrope18:03, 21 July 2011
r92791Use proper nosuchuser msg (fix for r86482)aaron20:56, 21 July 2011
r92854Avoid redefining TESTWIKI constant (Het wrappers already do this)aaron10:32, 22 July 2011
r92958Changed Maintenance::shouldExecute() to allow for multiple requires() in the ...aaron19:50, 23 July 2011
r93141Add support for relative-protocol urls in mw.loader.loadkrinkle23:04, 25 July 2011
r93303Typo in message autoblockedtext...hashar19:46, 27 July 2011

Status & tagging log