mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-08-23 15:31:00 +02:00
add patch for better favicon fetching (closes #231)
This commit is contained in:
parent
14d9001eca
commit
107008cb15
@ -395,10 +395,14 @@
|
|||||||
$faviconURL = $urlParts['scheme'].'://'.$urlParts['host'].$linkUrl;
|
$faviconURL = $urlParts['scheme'].'://'.$urlParts['host'].$linkUrl;
|
||||||
} else if (substr($linkUrl, 0, 7) == 'http://') {
|
} else if (substr($linkUrl, 0, 7) == 'http://') {
|
||||||
$faviconURL = $linkUrl;
|
$faviconURL = $linkUrl;
|
||||||
} else if (substr($url, -1, 1) == '/') {
|
|
||||||
$faviconURL = $url.$linkUrl;
|
|
||||||
} else {
|
} else {
|
||||||
$faviconURL = $url.'/'.$linkUrl;
|
$pos = strrpos($url, "/");
|
||||||
|
// no "/" in url or "/" is part of "://"
|
||||||
|
if ($pos === false || $pos == (strpos($url, "://")+2)) {
|
||||||
|
$faviconURL = $url.'/'.$linkUrl;
|
||||||
|
} else {
|
||||||
|
$faviconURL = substr($url, 0, $pos+1).$linkUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -454,7 +458,7 @@
|
|||||||
|
|
||||||
$http_response = fgets( $socket, 22 );
|
$http_response = fgets( $socket, 22 );
|
||||||
|
|
||||||
$responses = "/(200 OK)|(30[0-9] Moved)/";
|
$responses = "/(200 OK)|(30[123])/";
|
||||||
if ( preg_match($responses, $http_response) ) {
|
if ( preg_match($responses, $http_response) ) {
|
||||||
fclose($socket);
|
fclose($socket);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user