Fix tests on PHP 5.4

This commit is contained in:
Romain Neutron
2012-09-27 02:47:59 +02:00
parent c8e0f05494
commit 3f9dc687dc
15 changed files with 36 additions and 52 deletions

View File

@@ -878,7 +878,8 @@ class module_report
public static function getHost($url)
{
$parse_url = parse_url(trim($url));
$result = isset($parse_url['host']) ? $parse_url['host'] : array_shift(explode('/', $parse_url['path'], 2));
$paths = explode('/', $parse_url['path'], 2);
$result = isset($parse_url['host']) ? $parse_url['host'] : array_shift($paths);
return trim($result);
}