فهرست منبع

Doc force-https (#7259)

* Doc force-https
https://github.com/FreshRSS/FreshRSS/discussions/7252#discussioncomment-11951183

* Forgotten ^

* More proper support for comments
Alexandre Alapetite 1 سال پیش
والد
کامیت
d7ca2f8768
2فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  1. 4 0
      force-https.default.txt
  2. 5 0
      lib/lib_rss.php

+ 4 - 0
force-https.default.txt

@@ -1,3 +1,7 @@
+# Do not modify this file, which defines default values,
+# but specify your own values in ./data/force-https.txt
+# Examples of values, one per line: com, example.org, www.example.net
+
 blogger.com
 creativecommons.org
 dailymotion.com

+ 5 - 0
lib/lib_rss.php

@@ -390,6 +390,11 @@ function customSimplePie(array $attributes = [], array $curl_options = []): \Sim
 	if (is_array($force)) {
 		$https_domains = array_merge($https_domains, $force);
 	}
+
+	// Remove whitespace and comments starting with # / ;
+	$https_domains = preg_replace('%\\s+|[\/#;].*$%', '', $https_domains) ?? $https_domains;
+	$https_domains = array_filter($https_domains, fn(string $v) => $v !== '');
+
 	$simplePie->set_https_domains($https_domains);
 	return $simplePie;
 }