Skip to content

Commit

Permalink
MDL-23720 fixed unicode issue in geoip results
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 9, 2010
1 parent bbb13f0 commit 8061887
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions iplookup/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Displays IP address on map
*
* @package moodlecore
* @package core
* @subpackage iplookup
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down Expand Up @@ -63,6 +63,8 @@
}
}

$textlib = textlib_get_instance();

if (!empty($CFG->geoipfile) and file_exists($CFG->geoipfile)) {
$geoip = Net_GeoIP::getInstance($CFG->geoipfile, Net_GeoIP::STANDARD);
$location = $geoip->lookupLocation($ip);
Expand All @@ -72,7 +74,7 @@
print_error('iplookupfailed', 'error', '', $ip);
}
if (!empty($location->city)) {
$info[] = $location->city;
$info[] = $textlib->convert($location->city, 'iso-8859-1', 'utf-8');
}

if (!empty($location->country_code)) {
Expand Down

0 comments on commit 8061887

Please sign in to comment.