function _syntaxhighlighter_comment_validate in Syntax Highlighter 8
Same name and namespace in other branches
- 7.2 syntaxhighlighter.module \_syntaxhighlighter_comment_validate()
- 7 syntaxhighlighter.module \_syntaxhighlighter_comment_validate()
Validate the comment input text to be sure that there are no bad tags.
1 string reference to '_syntaxhighlighter_comment_validate'
File
- ./
syntaxhighlighter.module, line 300 - Syntax highlight code using the SyntaxHighlighter Javascript library.
Code
function _syntaxhighlighter_comment_validate($form, FormStateInterface $form_state) {
$comment_body = $form_state
->getValue('comment_body');
if (isset($comment_body)) {
$format = isset($comment_body[0]['format']) ? $comment_body[0]['format'] : filter_fallback_format();
if (_syntaxhighlighter_format_has_syntaxhighlighter_filter($format)) {
_syntaxhighlighter_validate_input($form_state, "comment_body][0][value", $comment_body[0]['value']);
}
}
}