From fa8bba78d8991212b45abd68ce85df71e83f9057 Mon Sep 17 00:00:00 2001
From: enured <enis.nuredini@uzh.ch>
Date: Wed, 16 Nov 2022 17:54:33 +0100
Subject: [PATCH] S15014: Generic Error fixed. Added documentation in License
 file. refs #15014

---
 Documentation/License.rst                    | 1 +
 extension/Classes/Core/AbstractBuildForm.php | 2 +-
 extension/Classes/Core/Save.php              | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/License.rst b/Documentation/License.rst
index 6a51955c8..11f7db351 100644
--- a/Documentation/License.rst
+++ b/Documentation/License.rst
@@ -59,3 +59,4 @@ Software distributed together with QFQ
 * Event Emitter - https://git.io/ee
 * FullCalendar - https://fullcalendar.io/
 * Datetimepicker - https://getdatepicker.com/
+* HTMLPurifier - https://github.com/ezyang/htmlpurifier
diff --git a/extension/Classes/Core/AbstractBuildForm.php b/extension/Classes/Core/AbstractBuildForm.php
index 6cd993ac4..1a75e62a3 100644
--- a/extension/Classes/Core/AbstractBuildForm.php
+++ b/extension/Classes/Core/AbstractBuildForm.php
@@ -3533,7 +3533,7 @@ abstract class AbstractBuildForm {
      * @return void
      */
     private function setTinymceEditorToolbarAttributes(&$toolbarFlags, &$attributeList, $attributeName, $specialAttributeName = '') {
-        if (!$toolbarFlags[$attributeName]) {
+        if (!empty($toolbarFlags[$attributeName]) && !$toolbarFlags[$attributeName]) {
             if ($specialAttributeName === '') {
                 $attributeList .= ' ' . $attributeName;
             } else {
diff --git a/extension/Classes/Core/Save.php b/extension/Classes/Core/Save.php
index 8b35b7d16..a4add1321 100644
--- a/extension/Classes/Core/Save.php
+++ b/extension/Classes/Core/Save.php
@@ -1766,7 +1766,7 @@ class Save {
      */
     function custom_strip_tags($html, string $allowedTags) {
         $allowed_tags = explode(',', $allowedTags);
-        $allowed_tags = array_map(strtolower, $allowed_tags);
+        $allowed_tags = array_map('strtolower', $allowed_tags);
         $regex_tags = '/<\/?([^>\s]+)[^>]*>/i';
         $matches = array();
         preg_match_all($regex_tags, $html, $matches);
-- 
GitLab