Unused variable in Image effect color validate function

Created on 12 March 2011, almost 14 years ago
Updated 7 June 2024, 7 months ago

Here is the validation image_effect_color function.
We can see that $hex_value is clearly unused, and so preg_replace function is not used for anything.

/**
 * Element validate handler to ensure a hexadecimal color value.
 */
function image_effect_color_validate($element, &$form_state) {
  if ($element['#value'] != '') {
    $hex_value = preg_replace('/^#/', '', $element['#value']);
    if (!preg_match('/^#[0-9A-F]{3}([0-9A-F]{3})?$/', $element['#value'])) {
      form_error($element, t('!name must be a hexadecimal color value.', array('!name' => $element['#title'])));
    }
  }
}
πŸ› Bug report
Status

Needs work

Version

7.0 ⚰️

Component
Image systemΒ  β†’

Last updated 1 day ago

Created by

πŸ‡«πŸ‡·France Haza

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024