From 667528d5b927f0f284a067b0e24c9ca7f26c28a4 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sat, 23 Nov 2024 18:23:49 +0000 Subject: Use PHP 8 'str_' functions. A few more characters in some places, but helps with readability. --- classes/Sanitizer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/Sanitizer.php') diff --git a/classes/Sanitizer.php b/classes/Sanitizer.php index 20ca72dc8..94d6fe621 100644 --- a/classes/Sanitizer.php +++ b/classes/Sanitizer.php @@ -20,11 +20,11 @@ class Sanitizer { foreach ($entry->attributes as $attr) { - if (strpos($attr->nodeName, 'on') === 0) { + if (str_starts_with($attr->nodeName, 'on')) { array_push($attrs_to_remove, $attr); } - if (strpos($attr->nodeName, "data-") === 0) { + if (str_starts_with($attr->nodeName, 'data-')) { array_push($attrs_to_remove, $attr); } -- cgit v1.2.3-54-g00ecf