function follow_build_url_regex in Follow 7
Same name and namespace in other branches
- 5 follow.module \follow_build_url_regex()
- 7.2 follow.inc \follow_build_url_regex()
Build a regex to validate the url based on a known service url.
1 call to follow_build_url_regex()
- follow_url_validate in ./
follow.module - Validates the url field to verify it's actually a url.
File
- ./
follow.module, line 591 - Allows users to add links to their social network profiles.
Code
function follow_build_url_regex($network_info) {
if (!empty($network_info['domain'])) {
// An external link.
return '@^https?://([a-z0-9\\-_.]+\\.|)' . str_replace('.', '\\.', $network_info['domain']) . '/@i';
}
// An internal link should not have ':'.
return '@^[^:]+$@';
}