From 13d180553d128193c6fbfeac1ff92c2695676316 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 24 Apr 2009 19:50:50 +0000 Subject: API: (bug 13049) This'll hopefully fix the 403 Forbidden error in api.php for the setups that were getting them (most notably FastCGI and IIS). Patch by Chris Wrinn --- api.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api.php') diff --git a/api.php b/api.php index eb223994d033..546969f23f72 100644 --- a/api.php +++ b/api.php @@ -51,10 +51,10 @@ wfProfileIn('api.php'); // // Ensure that all access is through the canonical entry point... // -if( isset( $_SERVER['SCRIPT_URL'] ) ) { - $url = $_SERVER['SCRIPT_URL']; +if( isset( $_SERVER['SCRIPT_NAME'] ) ) { + $url = $_SERVER['SCRIPT_NAME']; } else { - $url = $_SERVER['PHP_SELF']; + $url = $_SERVER['URL']; } if( strcmp( "$wgScriptPath/api$wgScriptExtension", $url ) ) { wfHttpError( 403, 'Forbidden', -- cgit v1.2.3