API: (bug 13049) This'll hopefully fix the 403 Forbidden error in api.php for the...
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 24 Apr 2009 19:50:50 +0000 (19:50 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 24 Apr 2009 19:50:50 +0000 (19:50 +0000)
CREDITS
RELEASE-NOTES
api.php

diff --git a/CREDITS b/CREDITS
index 71066b5..f43ecca 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -61,6 +61,7 @@ following names for their contribution to the product.
 * Brent G
 * Brianna Laugher
 * Carlin
+* Chris Wrinn
 * church of emacs
 * Daniel Arnold
 * Danny B.
index a37d1f5..16e1410 100644 (file)
@@ -425,6 +425,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 18546) Added timestamp of new revision to action=edit output
 * (bug 18554) Also list hidden revisions in list=usercontribs for privileged
   users
+* (bug 13049) "API must be accessed from the primary script entry point" error 
 
 === Languages updated in 1.15 ===
 
diff --git a/api.php b/api.php
index eb22399..546969f 100644 (file)
--- 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',