Browse files

Detect dev mode correctly

- Use Director::isDev()
- Eliminate call to deprecated ereg()
  • Loading branch information...
1 parent a619819 commit de27cf89f06d5f5ca1dd1c9488bf5333db53061a Fred Condo committed Jun 21, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 code/Geoip.php
View
2 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 (Director::isDev() && isset($_GET['country'])){
$code = $_GET['country'];
}
elseif (isset($_SERVER['REMOTE_ADDR']) && self::is_enabled()) {

0 comments on commit de27cf8

Please sign in to comment.