On this page
function color_scheme_form_validate
color_scheme_form_validate($form, &$form_state)
Form validation handler for color_scheme_form().
See also
File
- modules/color/color.module, line 349
- Allows users to change the color scheme of themes.
Code
function color_scheme_form_validate($form, &$form_state) {
// Only accept hexadecimal CSS color strings to avoid XSS upon use.
foreach ($form_state['values']['palette'] as $key => $color) {
if (!color_valid_hexadecimal_string($color)) {
form_set_error('palette][' . $key, t('%name must be a valid hexadecimal CSS color value.', array('%name' => $form['color']['palette'][$key]['#title'])));
}
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!color!color.module/function/color_scheme_form_validate/7.x