From ce15802830b2e51ee2770e7040b652102d4cde82 Mon Sep 17 00:00:00 2001 From: Phyks Date: Fri, 18 Jul 2014 18:53:43 +0200 Subject: [PATCH] Solve issue #1 --- favicon.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/favicon.php b/favicon.php index 99857a8..512e6c2 100644 --- a/favicon.php +++ b/favicon.php @@ -88,9 +88,26 @@ function getFavicon($urls) { // Check for errorred feeds wether the favicon.ico file at the root exists $second_try = array(); foreach ($errors as $url) { + $parsed_url = parse_url(trim($url)); + $second_try_url = ""; + if(isset($parsed_url['scheme'])) { + $second_try_url .= $parsed_url['scheme']; + } + if(isset($parsed_url['host'])) { + $second_try_url .= $parsed_url['host']; + } + if(isset($parsed_url['port'])) { + $second_try_url .= $parsed_url['port']; + } + if(isset($parsed_url['user'])) { + $second_try_url .= $parsed_url['user']; + } + if(isset($parsed_url['pass'])) { + $second_try_url .= $parsed_url['pass']; + } $second_try[] = array( 'input_url'=>$url, - 'url'=>rtrim(trim($url), '/?') . '/favicon.ico' + 'url'=>$second_try_url . '/favicon.ico' ); } $second_try_curl = curl_downloader($second_try, false);