You are here

function syntaxhighlighter_node_validate in Syntax Highlighter 7

Same name and namespace in other branches
  1. 7.2 syntaxhighlighter.module \syntaxhighlighter_node_validate()

Validate on the node input text to be sure there is no bad {syntaxhighlighter} tags

File

./syntaxhighlighter.module, line 242
Syntax highlight code using the Syntaxhighlighter javascript library. See http://alexgorbatchev.com/wiki/SyntaxHighlighter

Code

function syntaxhighlighter_node_validate($node, $form, &$form_state) {
  if (isset($node->body)) {
    foreach ($node->body as $lang => $v) {
      if (_syntaxhighlighter_format_has_syntaxhighlighter_filter(isset($v[0]['format']) ? $v[0]['format'] : filter_fallback_format())) {
        if (!empty($v[0]['summary'])) {
          _syntaxhighlighter_validate_input("body][{$lang}][0][summary", $v[0]['summary']);
        }
        _syntaxhighlighter_validate_input("body][{$lang}][0][value", $v[0]['value']);
      }
    }
  }
}