Pārlūkot izejas kodu

SimplePie faster regex for sanitizing URLs

Can simplify the regex (faster because anchored) for cleaning URLs based
on the fact that we only have to deal with HTTP or HTTPS
https://github.com/FreshRSS/FreshRSS/pull/715
Alexandre Alapetite 11 gadi atpakaļ
vecāks
revīzija
7735471140
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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
 	function url_remove_credentials($url)	//FreshRSS
 	{
 	{
-		return preg_replace('#(?<=//)[^/:@]+:[^/:@]+@#', '', $url);
+		return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url);
 	}
 	}
 }
 }