fix bug #175 IP addresses do not appear in view original

This commit is contained in:
Nicolas Lœuillet 2013-08-25 08:01:18 +02:00
parent 27574abf46
commit d7c2f0cc47

View file

@ -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<domain>[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) {