From fab746c17cad17bc7d611447a9ce8e5a18bb0d3b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 11 Sep 2008 00:07:32 +0000 Subject: [PATCH] (bug 15544) non-index.php entry points prior to setup produced a bad /config/index.php url. Weird edge case, patch by Matt Johnston. Fix out-of-place entry in CREDITS too. --- CREDITS | 3 ++- RELEASE-NOTES | 2 ++ includes/templates/NoLocalSettings.php | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 14c086b24f..f12d33878a 100644 --- a/CREDITS +++ b/CREDITS @@ -42,12 +42,13 @@ following names for their contribution to the product. * Daniel Arnold * Danny B. * Jeremy Baron +* Juliano F. Ravasi * Louperivois +* Matt Johnston * Max Semenik * Michael De La Rue * Mike Horvath * Mormegil -* Juliano F. Ravasi * RememberTheDot * ST47 diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f6c0c35186..5ed6c8cfb5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -189,6 +189,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14398) mwsuggest.js: Let width of container be configurable * (bug 15543) Only include user touched timestamp to generated CSS * (bug 15497) Removed encoding attribute from tag +* (bug 15544) Wiki not set up message (NoLocalSettings.php) now works for + non-index.php entry pages (e.g. api.php). Patch by Matt Johnston. === API changes in 1.14 === diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php index 75a7e95a93..fde97067b2 100644 --- a/includes/templates/NoLocalSettings.php +++ b/includes/templates/NoLocalSettings.php @@ -17,6 +17,10 @@ $path = ''; if( isset( $_SERVER['SCRIPT_NAME'] )) { $path = htmlspecialchars( preg_replace('/index.php5?/', '', $_SERVER['SCRIPT_NAME']) ); } +#Remove filename in path, prevents going to corrupt URLs (e.g. http://server/path/api.phpconfig/index.php) +if(substr($path, strlen($path)-1) != "/"){ + $path = substr($path, 0, strrpos($path, "/")+1); +} ?> -- 2.20.1