1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-28 12:10:52 +02:00

fix_url: support schema-less urls

This commit is contained in:
Andrew Dolgov 2015-06-08 14:18:49 +03:00
parent 415a3b50c9
commit dd6e2386fd

View File

@ -1739,6 +1739,12 @@
* @return string Fixed URL.
*/
function fix_url($url) {
// support schema-less urls
if (strpos($url, '//') === 0) {
$url = 'https:' . $url;
}
if (strpos($url, '://') === false) {
$url = 'http://' . $url;
} else if (substr($url, 0, 5) == 'feed:') {