function facebook_comments_block_validate_absolute_url in Facebook Comments Block 7.2
Same name and namespace in other branches
- 7 facebook_comments_block.module \facebook_comments_block_validate_absolute_url()
Helper function to validate absolute URL.
1 string reference to 'facebook_comments_block_validate_absolute_url'
File
- ./
facebook_comments_block.module, line 298 - Code for the Facebook Comments Block module.
Code
function facebook_comments_block_validate_absolute_url($element, &$form_state) {
// trim trailing slash from the URL.
$value = rtrim(rtrim($element['#value']), '/');
if ($value !== '' && !valid_url($value, TRUE)) {
form_error($element, t('%name must be a valid absolute URL.', array(
'%name' => $element['#title'],
)));
}
}