Browse Source

strip_harmful_tags: remove data- attributes

Andrew Dolgov 1 year ago
parent
commit
50052fb78a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      include/functions.php

+ 4 - 0
include/functions.php

@@ -1761,6 +1761,10 @@
 						array_push($attrs_to_remove, $attr);
 					}
 
+					if (strpos($attr->nodeName, "data-") === 0) {
+						array_push($attrs_to_remove, $attr);
+					}
+
 					if ($attr->nodeName == 'href' && stripos($attr->value, 'javascript:') === 0) {
 						array_push($attrs_to_remove, $attr);
 					}