api.php: Use $wgRequest to retrieve User-agent string
authorSergio Santoro <santoro.srg@gmail.com>
Sun, 20 Jul 2014 13:47:21 +0000 (15:47 +0200)
committerSergio Santoro <santoro.srg@gmail.com>
Sun, 20 Jul 2014 13:47:21 +0000 (15:47 +0200)
api.php was directly accessing $_SERVER superglobal.
It should use WebRequest wrapper object instead.

Change-Id: I244fb7a35476e9a35a5dc97f898d39c82c54b7fa

api.php

diff --git a/api.php b/api.php
index e8a911e..80abc35 100644 (file)
--- a/api.php
+++ b/api.php
@@ -104,7 +104,7 @@ if ( $wgAPIRequestLog ) {
                wfTimestamp( TS_MW ),
                $endtime - $starttime,
                $wgRequest->getIP(),
-               $_SERVER['HTTP_USER_AGENT']
+               $wgRequest->getHeader( 'User-agent' )
        );
        $items[] = $wgRequest->wasPosted() ? 'POST' : 'GET';
        if ( $processor ) {