Moved global define into class constant, replaced a bunch of $fname with __METHOD__.
[lhc/web/wiklou.git] / api.php
diff --git a/api.php b/api.php
index 39d27dd..05a881e 100644 (file)
--- a/api.php
+++ b/api.php
@@ -103,6 +103,9 @@ if ( $wgCrossSiteAJAXdomains && isset( $_SERVER['HTTP_ORIGIN'] ) ) {
 
 // Set a dummy $wgTitle, because $wgTitle == null breaks various things
 // In a perfect world this wouldn't be necessary
+//
+// @todo @fixme Ummmm, doesn't this line make the PHP4 check at the top completely
+// useless? Suggest moving more stuff out of api.php like we did with index.php
 $wgTitle = Title::makeTitle( NS_MAIN, 'API' );
 
 /* Construct an ApiMain with the arguments passed via the URL. What we get back
@@ -127,7 +130,7 @@ if ( $wgAPIRequestLog ) {
        $items = array(
                        wfTimestamp( TS_MW ),
                        $endtime - $starttime,
-                       wfGetIP(),
+                       $wgRequest->getIP(),
                        $_SERVER['HTTP_USER_AGENT']
        );
        $items[] = $wgRequest->wasPosted() ? 'POST' : 'GET';