Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Silverstripe 3 fixes #7

Merged
merged 5 commits into from

2 participants

@oddnoc
  • Correct typos
  • Update version restriction so composer will load the module in SilverStripe 3
  • Remove call to deprecated ereg()
Fred Condo added some commits
Fred Condo Truncate _config.php
_config.php without code does not need to contain any text, not even the
<?php tag.
bba3f60
Fred Condo Correct transpositions in text 0eae760
Fred Condo Update version constraint to allow SilverStripe 3 2f03230
Fred Condo Clean up if/elseif syntax a619819
Fred Condo Detect dev mode correctly
- Use Director::isDev()
- Eliminate call to deprecated ereg()
de27cf8
@wilr wilr merged commit 04ce7a8 into silverstripe-labs:master
@oddnoc oddnoc deleted the oddnoc:silverstripe3-fixes branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 21, 2013
  1. Truncate _config.php

    Fred Condo authored
    _config.php without code does not need to contain any text, not even the
    <?php tag.
  2. Correct transpositions in text

    Fred Condo authored
  3. Update version constraint to allow SilverStripe 3

    Fred Condo authored
  4. Clean up if/elseif syntax

    Fred Condo authored
  5. Detect dev mode correctly

    Fred Condo authored
    - Use Director::isDev()
    - Eliminate call to deprecated ereg()
This page is out of date. Refresh to see the latest.
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"
}
}
Something went wrong with that request. Please try again.