1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-30 04:42:19 -05:00

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) public static function getDomain($url)
{ {
$pieces = parse_url($url); return parse_url($url, PHP_URL_HOST);
$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;
} }
public static function getReadingTime($text) { public static function getReadingTime($text) {