You are here

function imagecache_admin_validate in ImageCache 5

File

./imagecache.module, line 437
Dynamic image resizer and image cacher.

Code

function imagecache_admin_validate($form_id, $form_values) {
  if (is_array($_POST['preset-op'])) {
    foreach ($_POST['preset-op'] as $presetid => $op) {

      // Check for illegal characters in preset names
      if (preg_match('/[^0-9a-zA-Z_\\-]/', $form_values['presets'][$presetid]['name'])) {
        form_set_error('presets][' . $presetid . '][name', t('Please only use alphanumic characters, underscores (_), and hyphens (-) for preset names.'));
      }
    }
  }
}