mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 17:45:55 +00:00
fix_url: support schema-less urls
This commit is contained in:
@@ -1739,6 +1739,12 @@
|
|||||||
* @return string Fixed URL.
|
* @return string Fixed URL.
|
||||||
*/
|
*/
|
||||||
function fix_url($url) {
|
function fix_url($url) {
|
||||||
|
|
||||||
|
// support schema-less urls
|
||||||
|
if (strpos($url, '//') === 0) {
|
||||||
|
$url = 'https:' . $url;
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($url, '://') === false) {
|
if (strpos($url, '://') === false) {
|
||||||
$url = 'http://' . $url;
|
$url = 'http://' . $url;
|
||||||
} else if (substr($url, 0, 5) == 'feed:') {
|
} else if (substr($url, 0, 5) == 'feed:') {
|
||||||
|
|||||||
Reference in New Issue
Block a user