Просмотр исходного кода

Strip credentials from HTTP Referer (#1891)

https://github.com/simplepie/simplepie/blob/0edf39018709c0d66cfa6d9b972907bb92461efb/library/SimplePie/File.php#L109
Candidate for pull-request upstream to SimplePie
Alexandre Alapetite 7 лет назад
Родитель
Сommit
f17417e95c
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/SimplePie/SimplePie/File.php

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

@@ -110,7 +110,7 @@ class SimplePie_File
 				curl_setopt($fp, CURLOPT_FAILONERROR, 1);
 				curl_setopt($fp, CURLOPT_TIMEOUT, $timeout);
 				curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout);
-				curl_setopt($fp, CURLOPT_REFERER, $url);
+				curl_setopt($fp, CURLOPT_REFERER, SimplePie_Misc::url_remove_credentials($url));
 				curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
 				curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
 				if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>='))