Commit 49b37dfa authored by Son Nguyen's avatar Son Nguyen
Browse files

Blog post with only images or allowed embed codes cannot be submitted


(Bug #1023630)

When striping HTML tags from WYSIWYG editor for checking required rules,
allow <img>,<iframe>,<object>,<embed> tags

Change-Id: I12d63d153bee4ef6169a3a6c7252d2491e505056
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 77145ea6
......@@ -90,7 +90,7 @@ function pieform_element_wysiwyg(Pieform $form, $element) {
}
function pieform_element_wysiwyg_rule_required(Pieform $form, $value, $element, $check) {
return $check && strip_tags($value) === '' ? $form->i18n('rule', 'required', 'required', $element) : '';
return $check && strip_tags($value, '<img><iframe><object><embed>') === '' ? $form->i18n('rule', 'required', 'required', $element) : '';
}
function pieform_element_wysiwyg_get_headdata() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment