Skip to content

Commit beb0777

Browse files
committed
Security: Remove on-attributes when showing an HTML editor in forms
Refs advisory GHSA-24cc-9jp9-rxx6
1 parent 7f75d70 commit beb0777

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main/inc/lib/formvalidator/Element/HtmlEditor.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* For licensing terms, see /license.txt */
33

44
use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor;
5+
use Chamilo\CoreBundle\Component\HTMLPurifier\Filter\RemoveOnAttributes;
56

67
/**
78
* A html editor field to use with QuickForm.
@@ -110,4 +111,12 @@ public function buildEditor($style = false)
110111

111112
return $result;
112113
}
114+
115+
/**
116+
* @return string|null
117+
*/
118+
public function getValue(): ?string
119+
{
120+
return RemoveOnAttributes::filter($this->_value);
121+
}
113122
}

0 commit comments

Comments
 (0)