From e4bb12329e8b895bfef4564296624cd47057d2be Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Tue, 2 May 2017 01:25:33 +0100 Subject: [PATCH] array_keys is probably faster --- Parsedown.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 488af4b..d42e4f5 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -1530,9 +1530,9 @@ class Parsedown } } - $onEventAttributes = preg_grep('/^on/i', array_flip($Element['attributes'])); + $onEventAttributeKeys = preg_grep('/^on/i', array_keys($Element['attributes'])); - foreach ($onEventAttributes as $att) + foreach ($onEventAttributeKeys as $att) { unset($Element['attributes'][$att]); }