r60202 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60201‎ | r60202 | r60203 >
Date:13:03, 18 December 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fix to geocoder classes.
Modified paths:
  • /trunk/extensions/Maps/Geocoders/Maps_Geocoder.php (modified) (history)
  • /trunk/extensions/Maps/Geocoders/Maps_GoogleGeocoder.php (modified) (history)
  • /trunk/extensions/Maps/Geocoders/Maps_YahooGeocoder.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Geocoders/Maps_GoogleGeocoder.php
@@ -34,8 +34,8 @@
3535 $result = self::GetResponse($requestURL);
3636
3737 //Check the Google Geocoder API Response code to ensure success
38 - if (substr($result, 0, 3) == "200") {
39 - $result = explode(",", $result);
 38+ if (substr($result, 0, 3) == '200') {
 39+ $result = explode(',', $result);
4040
4141 //$precision = $result[1];
4242 $latitude = $result[2];
Index: trunk/extensions/Maps/Geocoders/Maps_Geocoder.php
@@ -74,8 +74,7 @@
7575 $wgAutoloadClasses[$egMapsAvailableGeoServices[$service]['class']] = $file;
7676
7777 // Call the geocode function in the spesific geocoder class.
78 - $phpAtLeast523 = MapsUtils::phpVersionIsEqualOrBigger('5.2.3');
79 - $coordinates = call_user_func(array($egMapsAvailableGeoServices[$service]['class'], 'geocode'), $phpAtLeast523 ? $address : array($address));
 78+ $coordinates = call_user_func(array($egMapsAvailableGeoServices[$service]['class'], 'geocode'), $address);
8079
8180 // Add the obtained coordinates to the cache when there is a result and the cache is enabled.
8281 if (self::$mEnableCache && $coordinates) {
Index: trunk/extensions/Maps/Geocoders/Maps_YahooGeocoder.php
@@ -32,8 +32,8 @@
3333
3434 $result = self::GetResponse($requestURL);
3535
36 - $lon = self::getXmlElementValue($result, "longitude");
37 - $lat = self::getXmlElementValue($result, "latitude");
 36+ $lon = self::getXmlElementValue($result, 'longitude');
 37+ $lat = self::getXmlElementValue($result, 'latitude');
3838
3939 // In case one of the values is not found, return false
4040 if (!$lon || !$lat) return false;

Status & tagging log