http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96559
Revision: 96559
Author: reedy
Date: 2011-09-08 12:49:01 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
MFT r92422, r93520, r93563, r94107, r94433, r95042, r95332, r95451, r96386
Tests excluded (due to movements etc)
Modified Paths:
--------------
branches/REL1_17/phase3/RELEASE-NOTES
branches/REL1_17/phase3/docs/hooks.txt
branches/REL1_17/phase3/includes/IP.php
branches/REL1_17/phase3/includes/ObjectCache.php
branches/REL1_17/phase3/includes/installer/Installer.php
branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php
branches/REL1_17/phase3/maintenance/Maintenance.php
branches/REL1_17/phase3/resources/mediawiki.util/mediawiki.util.js
Property Changed:
----------------
branches/REL1_17/phase3/RELEASE-NOTES
branches/REL1_17/phase3/docs/hooks.txt
branches/REL1_17/phase3/includes/IP.php
branches/REL1_17/phase3/includes/installer/Installer.php
branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
Modified: branches/REL1_17/phase3/RELEASE-NOTES
===================================================================
--- branches/REL1_17/phase3/RELEASE-NOTES 2011-09-08 12:45:37 UTC (rev
96558)
+++ branches/REL1_17/phase3/RELEASE-NOTES 2011-09-08 12:49:01 UTC (rev
96559)
@@ -54,6 +54,13 @@
wide pano/timeline/diagram SVGs renderable at saner sizes.
* (bug 29959) Installer fatal when cURL and allow_url_fopen is disabled and
user
tries to subsribe to mediawiki-announce.
+* Installer checked for magic_quotes_runtime instead of register_globals
+* (bug 30131) XCache with variable caching disabled no longer used for variable
+ caching (CACHE_ACCEL)
+* (bug 30264) Changed installer-generated LocalSettings.php to use
require_once()
+ instead require() for included extensions.
+* (bug 26486) ResourceLoader modules with paths to nonexistent files cause PHP
+ warnings/notices to be thrown
=== Changes since 1.17.0rc1 ===
Property changes on: branches/REL1_17/phase3/RELEASE-NOTES
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/RELEASE-NOTES:51646
/branches/new-installer/phase3/RELEASE-NOTES:43664-66004
/branches/sqlite/RELEASE-NOTES:58211-58321
/trunk/phase3/HISTORY:79860,80620
/trunk/phase3/RELEASE-NOTES:79166,79324,79454-79456,79536,79557,79727,79733,79746,79773-79774,80109,80113,80163,80222-80223,80322,80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80475,80492,80495,80540,80554,80575,80608,80610,80620,80656,80666,80679,80685,80694,80728,80765,80841,81121,81124,81177,81186-81187,81197,81209-81211,81215,81238,81246,81262,81264,81430,81467,81488,81490,81496,81554,81561,81589,81600,81611,81620,81622,81640,81648,81650-81652,81692,81707,81729,81731,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955,82038-82039,82297,82307,82309,82312,82315,82337,82391-82392,82403,82411,82446,82457,82466,82473,82475,82478,82482,82486,82518,82530,82538,82547,82550,82565,82572,82608,82696,82748,82810,82813-82815,82818,82836,82845,82847-82848,82853,82858,82871,82938,83005,83015,83046,83114,83153,83173,83270,83284,83374,83390,83392,83402-83403,83410-83411,83420,83461,83463,83476,83489,83496,83586-83587,83798,83814,83876,83979,83988-83989,83997-83998,84118,84228,84271,84343,84353,84392,84430-84431,84459,84464,84543,84553,84573-84574,84577,84579,84729,84765,84820,84846,84905,84985,85006,85032,85140,85143,85152,85178,85194,85199,85377,85547,85555,85583,85803,85881,86065,86100,86121,86130,86142,86146,86182,86210,86257,86385,86394,86418,89855,91618,91719
+ /branches/REL1_15/phase3/RELEASE-NOTES:51646
/branches/new-installer/phase3/RELEASE-NOTES:43664-66004
/branches/sqlite/RELEASE-NOTES:58211-58321
/trunk/phase3/HISTORY:79860,80620
/trunk/phase3/RELEASE-NOTES:79166,79324,79454-79456,79536,79557,79727,79733,79746,79773-79774,80109,80113,80163,80222-80223,80322,80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80475,80492,80495,80540,80554,80575,80608,80610,80620,80656,80666,80679,80685,80694,80728,80765,80841,81121,81124,81177,81186-81187,81197,81209-81211,81215,81238,81246,81262,81264,81430,81467,81488,81490,81496,81554,81561,81589,81600,81611,81620,81622,81640,81648,81650-81652,81692,81707,81729,81731,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955,82038-82039,82297,82307,82309,82312,82315,82337,82391-82392,82403,82411,82446,82457,82466,82473,82475,82478,82482,82486,82518,82530,82538,82547,82550,82565,82572,82608,82696,82748,82810,82813-82815,82818,82836,82845,82847-82848,82853,82858,82871,82938,83005,83015,83046,83114,83153,83173,83270,83284,83374,83390,83392,83402-83403,83410-83411,83420,83461,83463,83476,83489,83496,83586-83587,83798,83814,83876,83979,83988-83989,83997-83998,84118,84228,84271,84343,84353,84392,84430-84431,84459,84464,84543,84553,84573-84574,84577,84579,84729,84765,84820,84846,84905,84985,85006,85032,85140,85143,85152,85178,85194,85199,85377,85547,85555,85583,85803,85881,86065,86100,86121,86130,86142,86146,86182,86210,86257,86385,86394,86418,89855,91618,91719,92422,93520,93563,94107,94433,95042,95332,95451,96386
Modified: branches/REL1_17/phase3/docs/hooks.txt
===================================================================
--- branches/REL1_17/phase3/docs/hooks.txt 2011-09-08 12:45:37 UTC (rev
96558)
+++ branches/REL1_17/phase3/docs/hooks.txt 2011-09-08 12:49:01 UTC (rev
96559)
@@ -600,7 +600,7 @@
'ContribsPager::getQueryInfo': Before the contributions query is about to run
&$pager: Pager object for contributions
-&queryInfo: The query for the contribs Pager
+&$queryInfo: The query for the contribs Pager
'ContributionsLineEnding': Called before a contributions HTML line is finished
$page: SpecialPage object for contributions
Property changes on: branches/REL1_17/phase3/docs/hooks.txt
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/docs/hooks.txt:51646
/branches/new-installer/phase3/docs/hooks.txt:43664-66004
/branches/sqlite/docs/hooks.txt:58211-58321
/trunk/phase3/docs/hooks.txt:78078,78262-78320,79246,79358,79480,79856,79877-79878,79885,79924,79926,79952,82000,82004,82020,82025,82038-82039,82048,82070,82081,82083,82090-82091,82095-82096,82129,82155-82156,82181,82191,82200,82203,82215,82219,82221,82253
+ /branches/REL1_15/phase3/docs/hooks.txt:51646
/branches/new-installer/phase3/docs/hooks.txt:43664-66004
/branches/sqlite/docs/hooks.txt:58211-58321
/trunk/phase3/docs/hooks.txt:78078,78262-78320,79246,79358,79480,79856,79877-79878,79885,79924,79926,79952,82000,82004,82020,82025,82038-82039,82048,82070,82081,82083,82090-82091,82095-82096,82129,82155-82156,82181,82191,82200,82203,82215,82219,82221,82253,92422,93520,93563,94107,94433,95042,95332,95451,96386
Modified: branches/REL1_17/phase3/includes/IP.php
===================================================================
--- branches/REL1_17/phase3/includes/IP.php 2011-09-08 12:45:37 UTC (rev
96558)
+++ branches/REL1_17/phase3/includes/IP.php 2011-09-08 12:49:01 UTC (rev
96559)
@@ -303,7 +303,7 @@
static $privateRanges = false;
if ( !$privateRanges ) {
$privateRanges = array(
- array( 'fc::',
'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local)
+ array( 'fc00::',
'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local)
array( '0:0:0:0:0:0:0:1', '0:0:0:0:0:0:0:1' ),
# loopback
);
}
Property changes on: branches/REL1_17/phase3/includes/IP.php
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/includes/IP.php:51646
/branches/new-installer/phase3/includes/IP.php:43664-66004
/branches/sqlite/includes/IP.php:58211-58321
/branches/wmf-deployment/includes/IP.php:53381
/trunk/phase3/includes/IP.php:82093,82095,82474,82845,82847-82848
+ /branches/REL1_15/phase3/includes/IP.php:51646
/branches/new-installer/phase3/includes/IP.php:43664-66004
/branches/sqlite/includes/IP.php:58211-58321
/branches/wmf-deployment/includes/IP.php:53381
/trunk/phase3/includes/IP.php:82093,82095,82474,82845,82847-82848,92422,93520,93563,94107,94433,95042,95332,95451,96386
Modified: branches/REL1_17/phase3/includes/ObjectCache.php
===================================================================
--- branches/REL1_17/phase3/includes/ObjectCache.php 2011-09-08 12:45:37 UTC
(rev 96558)
+++ branches/REL1_17/phase3/includes/ObjectCache.php 2011-09-08 12:49:01 UTC
(rev 96559)
@@ -66,7 +66,7 @@
$wgCaches[CACHE_ACCEL] = new eAccelBagOStuff;
} elseif ( function_exists( 'apc_fetch') ) {
$wgCaches[CACHE_ACCEL] = new APCBagOStuff;
- } elseif( function_exists( 'xcache_get' ) ) {
+ } elseif( function_exists( 'xcache_get' ) &&
wfIniGetBool( 'xcache.var_size' ) ) {
$wgCaches[CACHE_ACCEL] = new XCacheBagOStuff();
} elseif( function_exists( 'wincache_ucache_get' ) ) {
$wgCaches[CACHE_ACCEL] = new
WinCacheBagOStuff();
Modified: branches/REL1_17/phase3/includes/installer/Installer.php
===================================================================
--- branches/REL1_17/phase3/includes/installer/Installer.php 2011-09-08
12:45:37 UTC (rev 96558)
+++ branches/REL1_17/phase3/includes/installer/Installer.php 2011-09-08
12:49:01 UTC (rev 96559)
@@ -782,6 +782,9 @@
$caches = array();
foreach ( $this->objectCaches as $name => $function ) {
if ( function_exists( $function ) ) {
+ if ( $name == 'xcache' && !wfIniGetBool(
'xcache.var_size' ) ) {
+ continue;
+ }
$caches[$name] = true;
}
}
Property changes on: branches/REL1_17/phase3/includes/installer/Installer.php
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/includes/installer/Installer.php:51646
/branches/new-installer/phase3/includes/installer/Installer.php:43664-66004
/branches/sqlite/includes/installer/Installer.php:58211-58321
/branches/wmf-deployment/includes/installer/Installer.php:53381
/trunk/phase3/includes/installer/Installer.php:81731,82038-82039,82247,82845,82847-82848,84431,84464,84543,84553,84573-84574,84577,84579,84729,84739,84755,84765,84820,84846,84875,84881-84882,84905,84970,84976,84985,85032,85140,85143,85152,85178,85194,85199,85377,85547,85555,85583,85803,85881,86065,86100,86121,86130,86142,86146,86182,86210,86257,86385,86394,87027,87203,87222,87265,87494,87497,87711,87840,88076,88492,88658,88870-88871,89003,89108,89114-89115,89129,89529,89532,89615,89653,89707,89821,92481
+ /branches/REL1_15/phase3/includes/installer/Installer.php:51646
/branches/new-installer/phase3/includes/installer/Installer.php:43664-66004
/branches/sqlite/includes/installer/Installer.php:58211-58321
/branches/wmf-deployment/includes/installer/Installer.php:53381
/trunk/phase3/includes/installer/Installer.php:81731,82038-82039,82247,82845,82847-82848,84431,84464,84543,84553,84573-84574,84577,84579,84729,84739,84755,84765,84820,84846,84875,84881-84882,84905,84970,84976,84985,85032,85140,85143,85152,85178,85194,85199,85377,85547,85555,85583,85803,85881,86065,86100,86121,86130,86142,86146,86182,86210,86257,86385,86394,87027,87203,87222,87265,87494,87497,87711,87840,88076,88492,88658,88870-88871,89003,89108,89114-89115,89129,89529,89532,89615,89653,89707,89821,92422,92481,93520,93563,94107,94433,95042,95332,95451,96386
Modified: branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
===================================================================
--- branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
2011-09-08 12:45:37 UTC (rev 96558)
+++ branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
2011-09-08 12:49:01 UTC (rev 96559)
@@ -129,7 +129,7 @@
foreach( $this->extensions as $extName ) {
$encExtName = self::escapePhpString( $extName );
- $localSettings .= "require(
\"extensions/$encExtName/$encExtName.php\" );\n";
+ $localSettings .= "require_once(
\"extensions/$encExtName/$encExtName.php\" );\n";
}
}
Property changes on:
branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php
___________________________________________________________________
Modified: svn:mergeinfo
-
/branches/REL1_15/phase3/includes/installer/LocalSettingsGenerator.php:51646
/branches/new-installer/phase3/includes/installer/LocalSettingsGenerator.php:43664-66004
/branches/sqlite/includes/installer/LocalSettingsGenerator.php:58211-58321
/branches/wmf-deployment/includes/installer/LocalSettingsGenerator.php:53381
/trunk/phase3/includes/installer/LocalSettingsGenerator.php:82845,82847-82848,84875,84881-84882,84970,84976,85021,85066,88658,89311,89529,89598,89821
+
/branches/REL1_15/phase3/includes/installer/LocalSettingsGenerator.php:51646
/branches/new-installer/phase3/includes/installer/LocalSettingsGenerator.php:43664-66004
/branches/sqlite/includes/installer/LocalSettingsGenerator.php:58211-58321
/branches/wmf-deployment/includes/installer/LocalSettingsGenerator.php:53381
/trunk/phase3/includes/installer/LocalSettingsGenerator.php:82845,82847-82848,84875,84881-84882,84970,84976,85021,85066,88658,89311,89529,89598,89821,92422,93520,93563,94107,94433,95042,95332,95451,96386
Modified:
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php
===================================================================
---
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php
2011-09-08 12:45:37 UTC (rev 96558)
+++
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php
2011-09-08 12:49:01 UTC (rev 96559)
@@ -360,7 +360,7 @@
}
wfProfileIn( __METHOD__.'-filemtime' );
- $filesMtime = max( array_map( 'filemtime', $files ) );
+ $filesMtime = max( array_map( array( __CLASS__, 'safeFilemtime'
), $files ) );
wfProfileOut( __METHOD__.'-filemtime' );
$this->modifiedTime[$context->getHash()] = max(
$filesMtime,
@@ -444,10 +444,16 @@
$js = '';
foreach ( array_unique( $scripts ) as $fileName ) {
$localPath = $this->getLocalPath( $fileName );
- $contents = file_get_contents( $localPath );
- if ( $contents === false ) {
+ if ( !file_exists( $localPath ) ) {
throw new MWException( __METHOD__.": script
file not found: \"$localPath\"" );
}
+ $contents = file_get_contents( $localPath );
+ if ( $wgResourceLoaderValidateStaticJS ) {
+ // Static files don't really need to be checked
as often; unlike
+ // on-wiki module they shouldn't change
unexpectedly without
+ // admin interference.
+ $contents = $this->validateScriptFile(
$fileName, $contents );
+ }
$js .= $contents . "\n";
}
return $js;
@@ -484,15 +490,16 @@
*
* This method can be used as a callback for array_map()
*
- * @param $path String: File path of script file to read
+ * @param $path String: File path of style file to read
* @return String: CSS data in script file
+ * @throws MWException if the file doesn't exist
*/
protected function readStyleFile( $path, $flip ) {
$localPath = $this->getLocalPath( $path );
- $style = file_get_contents( $localPath );
- if ( $style === false ) {
+ if ( !file_exists( $localPath ) ) {
throw new MWException( __METHOD__.": style file not
found: \"$localPath\"" );
}
+ $style = file_get_contents( $localPath );
if ( $flip ) {
$style = CSSJanus::transform( $style, true, false );
}
@@ -506,4 +513,30 @@
$style, $dir, $remoteDir, true
);
}
+
+ /**
+ * Safe version of filemtime(), which doesn't throw a PHP warning if
the file doesn't exist
+ * but returns 1 instead.
+ * @param $filename string File name
+ * @return int UNIX timestamp, or 1 if the file doesn't exist
+ */
+ protected static function safeFilemtime( $filename ) {
+ if ( file_exists( $filename ) ) {
+ return filemtime( $filename );
+ } else {
+ // We only ever map this function on an array if we're
gonna call max() after,
+ // so return our standard minimum timestamps here. This
is 1, not 0, because
+ // wfTimestamp(0) == NOW
+ return 1;
+ }
+ }
+
+ /**
+ * Get whether CSS for this module should be flipped
+ * @param $context ResourceLoaderContext
+ * @return bool
+ */
+ public function getFlip( $context ) {
+ return $context->getDirection() === 'rtl';
+ }
}
Modified: branches/REL1_17/phase3/maintenance/Maintenance.php
===================================================================
--- branches/REL1_17/phase3/maintenance/Maintenance.php 2011-09-08 12:45:37 UTC
(rev 96558)
+++ branches/REL1_17/phase3/maintenance/Maintenance.php 2011-09-08 12:49:01 UTC
(rev 96559)
@@ -565,10 +565,14 @@
} elseif ( substr( $arg, 0, 2 ) == '--' ) {
# Long options
$option = substr( $arg, 2 );
+ if ( array_key_exists( $option, $options ) ) {
+ $this->error( "\nERROR: $option
parameter given twice\n" );
+ $this->maybeHelp( true );
+ }
if ( isset( $this->mParams[$option] ) &&
$this->mParams[$option]['withArg'] ) {
$param = next( $argv );
if ( $param === false ) {
- $this->error( "\nERROR: $option
needs a value after it\n" );
+ $this->error( "\nERROR: $option
parameter needs a value after it\n" );
$this->maybeHelp( true );
}
$options[$option] = $param;
@@ -586,10 +590,14 @@
# Short options
for ( $p = 1; $p < strlen( $arg ); $p++ ) {
$option = $arg { $p } ;
+ if ( array_key_exists( $option,
$options ) ) {
+ $this->error( "\nERROR: $option
parameter given twice\n" );
+ $this->maybeHelp( true );
+ }
if ( isset(
$this->mParams[$option]['withArg'] ) && $this->mParams[$option]['withArg'] ) {
$param = next( $argv );
if ( $param === false ) {
- $this->error( "\nERROR:
$option needs a value after it\n" );
+ $this->error( "\nERROR:
$option parameter needs a value after it\n" );
$this->maybeHelp( true
);
}
$options[$option] = $param;
Modified: branches/REL1_17/phase3/resources/mediawiki.util/mediawiki.util.js
===================================================================
--- branches/REL1_17/phase3/resources/mediawiki.util/mediawiki.util.js
2011-09-08 12:45:37 UTC (rev 96558)
+++ branches/REL1_17/phase3/resources/mediawiki.util/mediawiki.util.js
2011-09-08 12:49:01 UTC (rev 96559)
@@ -139,7 +139,9 @@
var re = new RegExp( '[^#]*[&?]' + $.escapeRE( param )
+ '=([^&#]*)' );
var m = re.exec( url );
if ( m && m.length > 1 ) {
- return decodeURIComponent( m[1] );
+ // Beware that decodeURIComponent is not
required to understand '+'
+ // by spec, as encodeURIComponent does not
produce it.
+ return decodeURIComponent( m[1].replace( /\+/g,
'%20' ) );
}
return null;
},
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs