Explorar el Código

Permet les protocoles relatifs pour HTTP/HTTPS automatique

Une vidéo telle <iframe
src="//www.youtube.com/embed/Q5okb9Vc8SY"></iframe> fonctionne
maintenant sur un FreshRSS hébergé en HTTPS.
Cela pourrait sûrement être écrit de manière plus propre quelque part
dans SimplePie_IRI::absolutize.
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/188
Alexandre Alapetite hace 12 años
padre
commit
be3b07a374
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      lib/SimplePie/SimplePie/Misc.php

+ 4 - 0
lib/SimplePie/SimplePie/Misc.php

@@ -79,6 +79,10 @@ class SimplePie_Misc
 
 	public static function absolutize_url($relative, $base)
 	{
+		if (substr($relative, 0, 2) === '//')	//FreshRSS: disable absolutize_url for "//www.example.net" which will pick HTTP or HTTPS automatically
+		{
+			return $relative;
+		}
 		$iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
 		if ($iri === false)
 		{