Procházet zdrojové kódy

SimplePie seems to only supports HTTP schemes

Can simplify the regex (faster because anchored) for cleaning URLs based
on the fact that we only have to deal with HTTP or HTTPS
Alexandre Alapetite před 11 roky
rodič
revize
1c38e646c3
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/SimplePie/SimplePie/Misc.php

+ 1 - 1
lib/SimplePie/SimplePie/Misc.php

@@ -2248,7 +2248,7 @@ function embed_wmedia(width, height, link) {
 	 */
 	function url_remove_credentials($url)	//FreshRSS
 	{
-		return preg_replace('#(?<=//)[^/:@]+:[^/:@]+@#', '', $url);
+		return preg_replace('#(?<=^https?://)[^/:@]+:[^/:@]+@#', '', $url);
 	}
 }