You are here

function cpn_block_validate in Code per Node 6

Same name and namespace in other branches
  1. 7 cpn.module \cpn_block_validate()

Block validation callback.

1 string reference to 'cpn_block_validate'
cpn_form_alter in ./cpn.module
Implemenation of hook_form_alter().

File

./cpn.module, line 351
Primary hook implementations.

Code

function cpn_block_validate($form, &$form_state) {

  // Ensure no "style" or "script" tags are included.
  if (cpn_validate($form_state['values']['cpn']['css'], 'css')) {
    form_set_error('cpn][css', t('Do not include @style tags in the CSS.', array(
      '@style' => '<style>',
    )));
  }
  if (cpn_validate($form_state['values']['cpn']['js'], 'js')) {
    form_set_error('cpn][js', t('Do not include @script tags in the JavaScript.', array(
      '@script' => '<script>',
    )));
  }
}