Index: branches/REL1_17/phase3/RELEASE-NOTES |
— | — | @@ -54,6 +54,13 @@ |
55 | 55 | wide pano/timeline/diagram SVGs renderable at saner sizes. |
56 | 56 | * (bug 29959) Installer fatal when cURL and allow_url_fopen is disabled and user |
57 | 57 | tries to subsribe to mediawiki-announce. |
| 58 | +* Installer checked for magic_quotes_runtime instead of register_globals |
| 59 | +* (bug 30131) XCache with variable caching disabled no longer used for variable |
| 60 | + caching (CACHE_ACCEL) |
| 61 | +* (bug 30264) Changed installer-generated LocalSettings.php to use require_once() |
| 62 | + instead require() for included extensions. |
| 63 | +* (bug 26486) ResourceLoader modules with paths to nonexistent files cause PHP |
| 64 | + warnings/notices to be thrown |
58 | 65 | |
59 | 66 | === Changes since 1.17.0rc1 === |
60 | 67 | |
Property changes on: branches/REL1_17/phase3/RELEASE-NOTES |
___________________________________________________________________ |
Modified: svn:mergeinfo |
61 | 68 | Merged /trunk/phase3/RELEASE-NOTES:r92422,93520,93563,94107,94433,95042,95332,95451,96386 |
Index: branches/REL1_17/phase3/resources/mediawiki.util/mediawiki.util.js |
— | — | @@ -139,7 +139,9 @@ |
140 | 140 | var re = new RegExp( '[^#]*[&?]' + $.escapeRE( param ) + '=([^&#]*)' ); |
141 | 141 | var m = re.exec( url ); |
142 | 142 | if ( m && m.length > 1 ) { |
143 | | - return decodeURIComponent( m[1] ); |
| 143 | + // Beware that decodeURIComponent is not required to understand '+' |
| 144 | + // by spec, as encodeURIComponent does not produce it. |
| 145 | + return decodeURIComponent( m[1].replace( /\+/g, '%20' ) ); |
144 | 146 | } |
145 | 147 | return null; |
146 | 148 | }, |
Index: branches/REL1_17/phase3/maintenance/Maintenance.php |
— | — | @@ -565,10 +565,14 @@ |
566 | 566 | } elseif ( substr( $arg, 0, 2 ) == '--' ) { |
567 | 567 | # Long options |
568 | 568 | $option = substr( $arg, 2 ); |
| 569 | + if ( array_key_exists( $option, $options ) ) { |
| 570 | + $this->error( "\nERROR: $option parameter given twice\n" ); |
| 571 | + $this->maybeHelp( true ); |
| 572 | + } |
569 | 573 | if ( isset( $this->mParams[$option] ) && $this->mParams[$option]['withArg'] ) { |
570 | 574 | $param = next( $argv ); |
571 | 575 | if ( $param === false ) { |
572 | | - $this->error( "\nERROR: $option needs a value after it\n" ); |
| 576 | + $this->error( "\nERROR: $option parameter needs a value after it\n" ); |
573 | 577 | $this->maybeHelp( true ); |
574 | 578 | } |
575 | 579 | $options[$option] = $param; |
— | — | @@ -586,10 +590,14 @@ |
587 | 591 | # Short options |
588 | 592 | for ( $p = 1; $p < strlen( $arg ); $p++ ) { |
589 | 593 | $option = $arg { $p } ; |
| 594 | + if ( array_key_exists( $option, $options ) ) { |
| 595 | + $this->error( "\nERROR: $option parameter given twice\n" ); |
| 596 | + $this->maybeHelp( true ); |
| 597 | + } |
590 | 598 | if ( isset( $this->mParams[$option]['withArg'] ) && $this->mParams[$option]['withArg'] ) { |
591 | 599 | $param = next( $argv ); |
592 | 600 | if ( $param === false ) { |
593 | | - $this->error( "\nERROR: $option needs a value after it\n" ); |
| 601 | + $this->error( "\nERROR: $option parameter needs a value after it\n" ); |
594 | 602 | $this->maybeHelp( true ); |
595 | 603 | } |
596 | 604 | $options[$option] = $param; |
Index: branches/REL1_17/phase3/docs/hooks.txt |
— | — | @@ -600,7 +600,7 @@ |
601 | 601 | |
602 | 602 | 'ContribsPager::getQueryInfo': Before the contributions query is about to run |
603 | 603 | &$pager: Pager object for contributions |
604 | | -&queryInfo: The query for the contribs Pager |
| 604 | +&$queryInfo: The query for the contribs Pager |
605 | 605 | |
606 | 606 | 'ContributionsLineEnding': Called before a contributions HTML line is finished |
607 | 607 | $page: SpecialPage object for contributions |
Property changes on: branches/REL1_17/phase3/docs/hooks.txt |
___________________________________________________________________ |
Modified: svn:mergeinfo |
608 | 608 | Merged /trunk/phase3/docs/hooks.txt:r92422,93520,93563,94107,94433,95042,95332,95451,96386 |
Index: branches/REL1_17/phase3/includes/ObjectCache.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | $wgCaches[CACHE_ACCEL] = new eAccelBagOStuff; |
68 | 68 | } elseif ( function_exists( 'apc_fetch') ) { |
69 | 69 | $wgCaches[CACHE_ACCEL] = new APCBagOStuff; |
70 | | - } elseif( function_exists( 'xcache_get' ) ) { |
| 70 | + } elseif( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) { |
71 | 71 | $wgCaches[CACHE_ACCEL] = new XCacheBagOStuff(); |
72 | 72 | } elseif( function_exists( 'wincache_ucache_get' ) ) { |
73 | 73 | $wgCaches[CACHE_ACCEL] = new WinCacheBagOStuff(); |
Index: branches/REL1_17/phase3/includes/IP.php |
— | — | @@ -303,7 +303,7 @@ |
304 | 304 | static $privateRanges = false; |
305 | 305 | if ( !$privateRanges ) { |
306 | 306 | $privateRanges = array( |
307 | | - array( 'fc::', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local) |
| 307 | + array( 'fc00::', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local) |
308 | 308 | array( '0:0:0:0:0:0:0:1', '0:0:0:0:0:0:0:1' ), # loopback |
309 | 309 | ); |
310 | 310 | } |
Property changes on: branches/REL1_17/phase3/includes/IP.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
311 | 311 | Merged /trunk/phase3/includes/IP.php:r92422,93520,93563,94107,94433,95042,95332,95451,96386 |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderFileModule.php |
— | — | @@ -360,7 +360,7 @@ |
361 | 361 | } |
362 | 362 | |
363 | 363 | wfProfileIn( __METHOD__.'-filemtime' ); |
364 | | - $filesMtime = max( array_map( 'filemtime', $files ) ); |
| 364 | + $filesMtime = max( array_map( array( __CLASS__, 'safeFilemtime' ), $files ) ); |
365 | 365 | wfProfileOut( __METHOD__.'-filemtime' ); |
366 | 366 | $this->modifiedTime[$context->getHash()] = max( |
367 | 367 | $filesMtime, |
— | — | @@ -444,10 +444,16 @@ |
445 | 445 | $js = ''; |
446 | 446 | foreach ( array_unique( $scripts ) as $fileName ) { |
447 | 447 | $localPath = $this->getLocalPath( $fileName ); |
448 | | - $contents = file_get_contents( $localPath ); |
449 | | - if ( $contents === false ) { |
| 448 | + if ( !file_exists( $localPath ) ) { |
450 | 449 | throw new MWException( __METHOD__.": script file not found: \"$localPath\"" ); |
451 | 450 | } |
| 451 | + $contents = file_get_contents( $localPath ); |
| 452 | + if ( $wgResourceLoaderValidateStaticJS ) { |
| 453 | + // Static files don't really need to be checked as often; unlike |
| 454 | + // on-wiki module they shouldn't change unexpectedly without |
| 455 | + // admin interference. |
| 456 | + $contents = $this->validateScriptFile( $fileName, $contents ); |
| 457 | + } |
452 | 458 | $js .= $contents . "\n"; |
453 | 459 | } |
454 | 460 | return $js; |
— | — | @@ -484,15 +490,16 @@ |
485 | 491 | * |
486 | 492 | * This method can be used as a callback for array_map() |
487 | 493 | * |
488 | | - * @param $path String: File path of script file to read |
| 494 | + * @param $path String: File path of style file to read |
489 | 495 | * @return String: CSS data in script file |
| 496 | + * @throws MWException if the file doesn't exist |
490 | 497 | */ |
491 | 498 | protected function readStyleFile( $path, $flip ) { |
492 | 499 | $localPath = $this->getLocalPath( $path ); |
493 | | - $style = file_get_contents( $localPath ); |
494 | | - if ( $style === false ) { |
| 500 | + if ( !file_exists( $localPath ) ) { |
495 | 501 | throw new MWException( __METHOD__.": style file not found: \"$localPath\"" ); |
496 | 502 | } |
| 503 | + $style = file_get_contents( $localPath ); |
497 | 504 | if ( $flip ) { |
498 | 505 | $style = CSSJanus::transform( $style, true, false ); |
499 | 506 | } |
— | — | @@ -506,4 +513,30 @@ |
507 | 514 | $style, $dir, $remoteDir, true |
508 | 515 | ); |
509 | 516 | } |
| 517 | + |
| 518 | + /** |
| 519 | + * Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist |
| 520 | + * but returns 1 instead. |
| 521 | + * @param $filename string File name |
| 522 | + * @return int UNIX timestamp, or 1 if the file doesn't exist |
| 523 | + */ |
| 524 | + protected static function safeFilemtime( $filename ) { |
| 525 | + if ( file_exists( $filename ) ) { |
| 526 | + return filemtime( $filename ); |
| 527 | + } else { |
| 528 | + // We only ever map this function on an array if we're gonna call max() after, |
| 529 | + // so return our standard minimum timestamps here. This is 1, not 0, because |
| 530 | + // wfTimestamp(0) == NOW |
| 531 | + return 1; |
| 532 | + } |
| 533 | + } |
| 534 | + |
| 535 | + /** |
| 536 | + * Get whether CSS for this module should be flipped |
| 537 | + * @param $context ResourceLoaderContext |
| 538 | + * @return bool |
| 539 | + */ |
| 540 | + public function getFlip( $context ) { |
| 541 | + return $context->getDirection() === 'rtl'; |
| 542 | + } |
510 | 543 | } |
Index: branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | |
131 | 131 | foreach( $this->extensions as $extName ) { |
132 | 132 | $encExtName = self::escapePhpString( $extName ); |
133 | | - $localSettings .= "require( \"extensions/$encExtName/$encExtName.php\" );\n"; |
| 133 | + $localSettings .= "require_once( \"extensions/$encExtName/$encExtName.php\" );\n"; |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
Property changes on: branches/REL1_17/phase3/includes/installer/LocalSettingsGenerator.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
137 | 137 | Merged /trunk/phase3/includes/installer/LocalSettingsGenerator.php:r92422,93520,93563,94107,94433,95042,95332,95451,96386 |
Index: branches/REL1_17/phase3/includes/installer/Installer.php |
— | — | @@ -782,6 +782,9 @@ |
783 | 783 | $caches = array(); |
784 | 784 | foreach ( $this->objectCaches as $name => $function ) { |
785 | 785 | if ( function_exists( $function ) ) { |
| 786 | + if ( $name == 'xcache' && !wfIniGetBool( 'xcache.var_size' ) ) { |
| 787 | + continue; |
| 788 | + } |
786 | 789 | $caches[$name] = true; |
787 | 790 | } |
788 | 791 | } |
Property changes on: branches/REL1_17/phase3/includes/installer/Installer.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
789 | 792 | Merged /trunk/phase3/includes/installer/Installer.php:r92422,93520,93563,94107,94433,95042,95332,95451,96386 |