You are here

function fckeditor_admin_profile_validate_fieldpaths in FCKeditor - WYSIWYG HTML editor 6.2

2 calls to fckeditor_admin_profile_validate_fieldpaths()
fckeditor_admin_global_profile_form_validate in ./fckeditor.admin.inc
fckeditor_admin_profile_form_validate in ./fckeditor.admin.inc
Profile validation.

File

./fckeditor.admin.inc, line 1271
FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben

Code

function fckeditor_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, implode('<br/>', $myerrors));
  }
}