From 8bc40d2d9c050ddaca59c3f8f486271ca23ecb24 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Mon, 14 Jan 2013 18:07:50 +0100 Subject: [PATCH] Removed a method to get the IP --- src/classes/utils/Utils.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/classes/utils/Utils.php b/src/classes/utils/Utils.php index 580586aa..b2581bd3 100644 --- a/src/classes/utils/Utils.php +++ b/src/classes/utils/Utils.php @@ -42,14 +42,13 @@ class Utils extends Thread{ } public static function getIP(){ - $ip = trim(Utils::curl_get("http://automation.whatismyip.com/n09230945.asp")); + $ip = "";//trim(Utils::curl_get("http://automation.whatismyip.com/n09230945.asp")); if($ip != ""){ return $ip; }else{ - $ip = trim(Utils::curl_get("http://checkip.dyndns.org/")); - $ip = preg_replace("/Current IP Address: (.*)/", '$1', $ip); - if($ip != ""){ - return $ip; + $ip = trim(strip_tags(Utils::curl_get("http://checkip.dyndns.org/"))); + if(preg_match('/Current IP Address\: (.*)/', $ip, $matches) > 0){ + return $matches[1]; }else{ return false; }