You are here

function shurly_url_exists in ShURLy 7

Same name and namespace in other branches
  1. 8 shurly.module \shurly_url_exists()
  2. 6 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
Validation of the main form
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
shurly_validate_long in ./shurly.module
Validate a long URL

File

./shurly.module, line 1067
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 && $redirect->destination == $long) {
    $return = 'match';
  }
  return $return;
}