Experiment with forcing HTTPS for selected embed providers

YouTube, DailyMotion, Tumblr
https://github.com/FreshRSS/FreshRSS/issues/1083
This commit is contained in:
Alexandre Alapetite
2016-02-21 22:19:07 +01:00
parent ad54c6624c
commit 83e58d3759

View File

@@ -77,6 +77,15 @@ class SimplePie_Misc
return $time;
}
/**
* Force HTTPS for selected Web sites
* FreshRSS
*/
public static https_url($url)
{
return preg_replace('%^http://((?:[^/]*?\.)?(?:youtube|dailymotion|tumblr)\.com/)%i', '//$1', $url);
}
public static function absolutize_url($relative, $base)
{
if (substr($relative, 0, 2) === '//')
@@ -88,7 +97,7 @@ class SimplePie_Misc
{
return false;
}
return $iri->get_uri();
return https_url($iri->get_uri());
}
/**