From 7628a11d8ec63eed3c64b11108ac512226111daf Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Wed, 7 Oct 2015 09:47:25 -0700 Subject: [PATCH] Remove .php5 entrypoints and $wgScriptExtension * The '.php5' entrypoints were deprecated in I68b1ae842, $wgScriptExtension in I3690f78bc. * Drop the associated ResourceLoader configuration variable, too. `mwgrep` shows no usage in the MediaWiki namespace. * Keep the scriptExtension configuration parameter for FileRepo for people who would like to interoperate with older MediaWiki installations that still use '.php5'. Change-Id: I17c8a15484b7e82cd5970d34e688109a2aae3840 --- RELEASE-NOTES-1.27 | 3 +++ api.php5 | 26 ------------------ img_auth.php5 | 26 ------------------ includes/DefaultSettings.php | 10 +++---- includes/GlobalFunctions.php | 6 ++--- includes/Setup.php | 10 +++---- includes/WebRequest.php | 3 +-- includes/filerepo/FileRepo.php | 2 +- includes/installer/WebInstallerPage.php | 5 +--- .../ResourceLoaderStartUpModule.php | 2 +- index.php5 | 26 ------------------ load.php5 | 26 ------------------ opensearch_desc.php5 | 26 ------------------ profileinfo.php5 | 26 ------------------ resources/src/mediawiki/mediawiki.util.js | 3 +-- .../mediawiki/mediawiki.util.test.js | 3 +-- thumb.php5 | 27 ------------------- thumb_handler.php5 | 27 ------------------- 18 files changed, 20 insertions(+), 237 deletions(-) delete mode 100644 api.php5 delete mode 100644 img_auth.php5 delete mode 100644 index.php5 delete mode 100644 load.php5 delete mode 100644 opensearch_desc.php5 delete mode 100644 profileinfo.php5 delete mode 100644 thumb.php5 delete mode 100644 thumb_handler.php5 diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index cf22127388..5fc2018b8b 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -22,6 +22,9 @@ production. production anymore. There is now $wgUseKeyHeader that provides similar functionality but instead of the MediaWiki-specific X-Vary-Options header, uses the draft Key header standard. +* $wgScriptExtension (and support for '.php5' entry points) was removed. See the + deprecation notice in the release notes for version 1.25 for advice on how to + preserve support for '.php5' entry points via URL rewriting. === New features in 1.27 === * $wgDataCenterId and $wgDataCenterRoles where added, which will serve as diff --git a/api.php5 b/api.php5 deleted file mode 100644 index 7512cdeb47..0000000000 --- a/api.php5 +++ /dev/null @@ -1,26 +0,0 @@ -scopedProfileIn( $fname . '-defaults' ); if ( $wgScript === false ) { - $wgScript = "$wgScriptPath/index$wgScriptExtension"; + $wgScript = "$wgScriptPath/index.php"; } if ( $wgLoadScript === false ) { - $wgLoadScript = "$wgScriptPath/load$wgScriptExtension"; + $wgLoadScript = "$wgScriptPath/load.php"; } if ( $wgArticlePath === false ) { @@ -186,7 +186,7 @@ if ( !$wgLocalFileRepo ) { 'name' => 'local', 'directory' => $wgUploadDirectory, 'scriptDirUrl' => $wgScriptPath, - 'scriptExtension' => $wgScriptExtension, + 'scriptExtension' => '.php', 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath, 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0, 'thumbScriptUrl' => $wgThumbnailScriptPath, @@ -503,10 +503,6 @@ require_once "$IP/includes/compat/normal/UtfNormalUtil.php"; $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' ); -if ( $wgScriptExtension !== '.php' || defined( 'MW_ENTRY_PHP5' ) ) { - wfWarn( 'Script extensions other than ".php" are deprecated.' ); -} - if ( $wgCanonicalServer === false ) { $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP ); } diff --git a/includes/WebRequest.php b/includes/WebRequest.php index bd80c7959b..824e684891 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -965,8 +965,7 @@ class WebRequest { * @return bool */ public function checkUrlExtension( $extWhitelist = array() ) { - global $wgScriptExtension; - $extWhitelist[] = ltrim( $wgScriptExtension, '.' ); + $extWhitelist[] = 'php'; if ( IEUrlExtension::areServerVarsBad( $_SERVER, $extWhitelist ) ) { if ( !$this->wasPosted() ) { $newUrl = IEUrlExtension::fixUrlForIE6( diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index c0ae3b6d0e..e79c06b8c2 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -79,7 +79,7 @@ class FileRepo { protected $scriptDirUrl; /** @var string Script extension of the MediaWiki installation, equivalent - * to $wgScriptExtension, e.g. .php5 defaults to .php */ + * to the old $wgScriptExtension, e.g. .php5 defaults to .php */ protected $scriptExtension; /** @var string Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1 */ diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 8715d51680..0d11463c62 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -669,8 +669,6 @@ class WebInstallerUpgrade extends WebInstallerPage { } public function showDoneMessage() { - global $wgScriptExtension; - $this->startForm(); $regenerate = !$this->getVar( '_ExistingDBSettings' ); if ( $regenerate ) { @@ -683,8 +681,7 @@ class WebInstallerUpgrade extends WebInstallerPage { $this->parent->getInfoBox( wfMessage( $msg, $this->getVar( 'wgServer' ) . - $this->getVar( 'wgScriptPath' ) . '/index' . - $wgScriptExtension + $this->getVar( 'wgScriptPath' ) . '/index.php' )->plain(), 'tick-32.png' ) ); diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index bc9a5b819a..4a672f27d6 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -67,7 +67,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { 'wgUrlProtocols' => wfUrlProtocols(), 'wgArticlePath' => $conf->get( 'ArticlePath' ), 'wgScriptPath' => $conf->get( 'ScriptPath' ), - 'wgScriptExtension' => $conf->get( 'ScriptExtension' ), + 'wgScriptExtension' => '.php', 'wgScript' => wfScript(), 'wgSearchType' => $conf->get( 'SearchType' ), 'wgVariantArticlePath' => $conf->get( 'VariantArticlePath' ), diff --git a/index.php5 b/index.php5 deleted file mode 100644 index 2a65c713d6..0000000000 --- a/index.php5 +++ /dev/null @@ -1,26 +0,0 @@ -