You are here

function shurly_url_exists in ShURLy 8

Same name and namespace in other branches
  1. 6 shurly.module \shurly_url_exists()
  2. 7 shurly.module \shurly_url_exists()

Check to see if this short URL already exists.

5 calls to shurly_url_exists()
ShurlyCreateForm::validateForm in src/Form/ShurlyCreateForm.php
Form validation handler.
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.
shurly_validate_long in ./shurly.module
Validate a long URL.

File

./shurly.module, line 573
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;
}