You are here

function ckeditor_admin_profile_validate_fieldpaths in CKEditor - WYSIWYG HTML editor 6

2 calls to ckeditor_admin_profile_validate_fieldpaths()
ckeditor_admin_global_profile_form_validate in includes/ckeditor.admin.inc
ckeditor_admin_profile_form_validate in includes/ckeditor.admin.inc
Profile validation.

File

includes/ckeditor.admin.inc, line 1963
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_admin_profile_validate_fieldpaths($fieldname, $paths) {
  $myerrors = array();
  $rules = preg_split('/[\\s,]+/', $paths);
  foreach ($rules as $rule) {
    $rule = trim($rule);
    if (!empty($rule) && strpos($rule, '.') === FALSE && strpos($rule, '/') === FALSE && strpos($rule, '-') === FALSE) {
      $myerrors[] = t('Rule %rule is ambiguous: please append .* if %rule is a path or prepend *. if %rule is a field.', array(
        '%rule' => $rule,
      ));
    }
  }
  if (!empty($myerrors)) {
    form_set_error($fieldname, check_plain(implode('<br/>', $myerrors)));
  }
}