r59100 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59099‎ | r59100 | r59101 >
Date:14:24, 15 November 2009
Author:vrandezo
Status:deferred
Tags:
Comment:
Checked if user agent field is set before using it
Modified paths:
  • /trunk/extensions/Maps/Geocoders/Maps_BaseGeocoder.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Geocoders/Maps_BaseGeocoder.php
@@ -55,7 +55,9 @@
5656
5757 curl_setopt($ch, CURLOPT_URL, $requestURL);
5858 curl_setopt($ch, CURLOPT_HEADER, 0); //Change this to a 1 to return headers
59 - curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
 59+ if (array_key_exists('HTTP_USER_AGENT', $_SERVER))
 60+ curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
 61+ // TODO else curl_setopt($ch, CURLOPT_USERAGENT, "MediaWiki/Maps extension");
6062 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
6163 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
6264

Status & tagging log