From 4b672d434ba1cd75e8affa74ed7879b1a129f7bd Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Wed, 22 Apr 2015 12:03:36 -0700 Subject: [PATCH] Follow-up for I68b1ae842: Deprecate $wgScriptExtension as well Change-Id: I3690f78bc57030d3f1e3992554ba0ae7eb393273 --- RELEASE-NOTES-1.25 | 9 +++++---- includes/DefaultSettings.php | 11 +++++++---- includes/Setup.php | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index e91a02e124..3303f30cc3 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -489,10 +489,11 @@ changes to languages because of Bugzilla reports. * $wgResourceModuleSkinStyles no longer supports per-module local or remote paths. They can only be set for the entire skin. * Removed global function swap(). (deprecated since 1.24) -* Deprecated the ".php5" file extension entry points. Refer to the ".php" files - instead. If you want ".php5" URLs to continue to work, set up redirects. In - Apache, this can be done by enabling mod_rewrite and adding the following - rules to your configuration: +* Deprecated the ".php5" file extension entry points and the $wgScriptExtension + configuration variable. Refer to the ".php" files instead. If you want + ".php5" URLs to continue to work, set up redirects. In Apache, this can be + done by enabling mod_rewrite and adding the following rules to your + configuration: RewriteEngine On RewriteBase / diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3ca54b5c0a..31724f6dcd 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -154,12 +154,15 @@ $wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) && ( strpos( PHP_SAPI, 'isapi' ) === false ); /** - * The extension to append to script names by default. This can either be .php - * or .php5. + * The extension to append to script names by default. + * + * Some hosting providers used PHP 4 for *.php files, and PHP 5 for *.php5. + * This variable was provided to support those providers. * - * Some hosting providers use PHP 4 for *.php files, and PHP 5 for *.php5. This - * variable is provided to support those providers. * @since 1.11 + * @deprecated since 1.25; support for '.php5' is being phased out of MediaWiki + * proper. Backward-compatibility can be maintained by configuring your web + * server to rewrite URLs. See RELEASE-NOTES for details. */ $wgScriptExtension = '.php'; diff --git a/includes/Setup.php b/includes/Setup.php index 7a333284c2..1324ed8bbe 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -485,8 +485,8 @@ require_once "$IP/includes/libs/normal/UtfNormalUtil.php"; $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' ); -if ( defined( 'MW_ENTRY_PHP5' ) ) { - wfWarn( 'The ".php5" entry point files are deprecated. Use ".php" instead.' ); +if ( $wgScriptExtension !== '.php' || defined( 'MW_ENTRY_PHP5' ) ) { + wfWarn( 'Script extensions other than ".php" are deprecated.' ); } if ( $wgCanonicalServer === false ) { -- 2.20.1