Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7 from oddnoc/silverstripe3-fixes

Silverstripe 3 fixes
  • Loading branch information...
commit 04ce7a8064a99b9beef3630b3eb9e6a579792871 2 parents ad2cc62 + de27cf8
@wilr wilr authored
Showing with 6 additions and 7 deletions.
  1. +0 −1  _config.php
  2. +4 −4 code/Geoip.php
  3. +2 −2 composer.json
View
1  _config.php
@@ -1 +0,0 @@
-<?php
View
8 code/Geoip.php
@@ -24,7 +24,7 @@ class Geoip {
protected static $iso_3166_countryCodes = array(
'A1' => "Anonymous Proxy",
'A2' => "Satellite Provider",
- 'A3' => "Internal Netwrok",
+ 'A3' => "Internal Network",
'AD' => "Andorra",
'AE' => "United Arab Emirates",
'AF' => "Afghanistan",
@@ -366,15 +366,15 @@ 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'];
}
- else if(isset($_SERVER['REMOTE_ADDR']) && self::is_enabled()) {
+ elseif (isset($_SERVER['REMOTE_ADDR']) && self::is_enabled()) {
$code = Geoip::ip2country($_SERVER['REMOTE_ADDR'], true);
}
// if geoip fails, lets default to default country code (if any)
- if(!isset($code) || !$code) {
+ if (!isset($code) || !$code) {
$code = self::get_default_country_code();
}
View
4 composer.json
@@ -1,6 +1,6 @@
{
"name": "silverstripe/geoip",
- "description": "GeoIP module for SivlerStripe.",
+ "description": "GeoIP module for SilverStripe.",
"type": "silverstripe-module",
"keywords": ["silverstripe-labs", "geoip"],
"authors": [
@@ -11,6 +11,6 @@
],
"require":
{
- "silverstripe/framework": "2.4.*"
+ "silverstripe/framework": ">=2.4.0"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.