diff --git a/code/CountryDropdownField.php b/code/CountryDropdownField.php index 6322c36..cbce70b 100644 --- a/code/CountryDropdownField.php +++ b/code/CountryDropdownField.php @@ -23,7 +23,7 @@ function defaultToVisitorCountry($val) { $this->defaultToVisitorCountry = $val; } - function Field() { + function Field($properties = array()) { $source = $this->getSource(); if($this->defaultToVisitorCountry && !$this->value || !isset($source[$this->value])) { diff --git a/code/Geoip.php b/code/Geoip.php index 168bcd1..2e88db9 100755 --- a/code/Geoip.php +++ b/code/Geoip.php @@ -366,7 +366,7 @@ static function ip2country($address, $codeOnly = false) { * @return string|bool */ static function visitor_country() { - if(ereg('^dev(\\.|$)', $_SERVER['HTTP_HOST']) && isset($_GET['country'])){ + if(preg_match('/^dev(\\.|$)/', $_SERVER['HTTP_HOST']) && isset($_GET['country'])){ $code = $_GET['country']; } else if(isset($_SERVER['REMOTE_ADDR']) && self::is_enabled()) {