function scald_youtube_validate_api_key in Scald YouTube 7
Form element validation handler for YouTube API key.
1 string reference to 'scald_youtube_validate_api_key'
File
- ./
scald_youtube.module, line 691 - Defines a YouTube provider for Scald.
Code
function scald_youtube_validate_api_key($element, &$form_state) {
if (!empty($form_state['values']['scald_youtube_api_key']) && !preg_match('/^[a-zA-Z0-9_\\-]+$/', $form_state['values']['scald_youtube_api_key'])) {
form_error($element, t('Invalid YouTube API Key.'));
}
}