Pārlūkot izejas kodu

sanitize: disallow width and height attributes for images

Andrew Dolgov 6 gadi atpakaļ
vecāks
revīzija
8babb8e75a
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      include/functions.php

+ 3 - 0
include/functions.php

@@ -1587,6 +1587,9 @@
 			if ($entry->nodeName == 'img') {
 				$entry->setAttribute('referrerpolicy', 'no-referrer');
 
+				$entry->removeAttribute('width');
+				$entry->removeAttribute('height');
+
 				if ($entry->hasAttribute('src')) {
 					$is_https_url = parse_url($entry->getAttribute('src'), PHP_URL_SCHEME) === 'https';