Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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'])));
}
}
}
Comment | File | Size | Author |
---|---|---|---|
#1 | 1090464.patch | 916 bytes | Haza |
Comments
Comment #1
HazaHere is a little patch, let see what the test bot think about that.
Comment #2
ArtusamakComment #3
oriol_e9ghead:
patch:
should not be reversed?