From: Nicolas LÅ“uillet Date: Sun, 25 Aug 2013 06:01:18 +0000 (+0200) Subject: fix bug #175 IP addresses do not appear in view original X-Git-Tag: 1.0-beta4~9 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d7c2f0cc47d829b1f242a10f03d15d80d28f3c0f;p=github%2Fwallabag%2Fwallabag.git fix bug #175 IP addresses do not appear in view original --- diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 8661ab6e..3a792d43 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -216,13 +216,7 @@ class Tools public static function getDomain($url) { - $pieces = parse_url($url); - $domain = isset($pieces['host']) ? $pieces['host'] : ''; - if (preg_match('/(?P[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) { - return $regs['domain']; - } - - return FALSE; + return parse_url($url, PHP_URL_HOST); } public static function getReadingTime($text) {