summaryrefslogtreecommitdiff
path: root/classes/sanitizer.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-01 10:20:21 +0300
committerAndrew Dolgov <[email protected]>2021-03-01 10:20:21 +0300
commit7ef72fe0dc0f360e04e15a46d137a12a518450b9 (patch)
tree747e88a041915b2d80c219cc0e6b88d1cb7a4767 /classes/sanitizer.php
parentb05d4e3d9ff2803b28dd68d807b57500f8c3078f (diff)
move startup checks to Config, set a bunch of @deprecated annotations
Diffstat (limited to 'classes/sanitizer.php')
-rw-r--r--classes/sanitizer.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/sanitizer.php b/classes/sanitizer.php
index 52feb5e28..5bb5f2efc 100644
--- a/classes/sanitizer.php
+++ b/classes/sanitizer.php
@@ -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")));