function shurly_url_exists in ShURLy 6
Same name and namespace in other branches
- 8 shurly.module \shurly_url_exists()
- 7 shurly.module \shurly_url_exists()
Check to see if this short URL already exists
5 calls to shurly_url_exists()
- shurly_create_form_validate in ./
shurly.module - shurly_generate_random in ./
shurly.module - Generate a random short URL Pretty much unused at this point this method could take a LOOOONG time on a site with lots of URLs
- shurly_next_url in ./
shurly.module - Return next available short URL
- shurly_shorten in ./
shurly.module - API function to shorten a URL @arg $long_url - the long URL to shorten @arg $custom - optional custom short URL, user_access('enter custom URLs') should be checked prior to calling shurly_shorten()
- shurly_validate_long in ./
shurly.module - Validate a long URL
File
- ./
shurly.module, line 806 - description http://www.youtube.com/watch?v=Qo7qoonzTCE
Code
function shurly_url_exists($short, $long = NULL) {
$redirect = shurly_get_redirect($short);
$return = FALSE;
if ($redirect) {
$return = 'found';
}
if ($long && $redirect->destination == $long) {
$return = 'match';
}
return $return;
}