1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 16:15:55 +00:00

move startup checks to Config, set a bunch of @deprecated annotations

This commit is contained in:
Andrew Dolgov
2021-03-01 10:20:21 +03:00
parent b05d4e3d9f
commit 7ef72fe0dc
15 changed files with 269 additions and 265 deletions

View File

@@ -49,6 +49,10 @@ class Sanitizer {
return false;
}
private static function is_prefix_https() {
return parse_url(Config::get(Config::SELF_URL_PATH), PHP_URL_SCHEME) == 'https';
}
public static function sanitize($str, $force_remove_images = false, $owner = false, $site_url = false, $highlight_words = false, $article_id = false) {
if (!$owner && isset($_SESSION["uid"]))
@@ -125,7 +129,7 @@ class Sanitizer {
if (!self::iframe_whitelisted($entry)) {
$entry->setAttribute('sandbox', 'allow-scripts');
} else {
if (is_prefix_https()) {
if (self::is_prefix_https()) {
$entry->setAttribute("src",
str_replace("http://", "https://",
$entry->getAttribute("src")));