diff options
author | Chaoyi Zha <summermontreal@gmail.com> | 2017-03-21 00:01:33 +0300 |
---|---|---|
committer | Chaoyi Zha <summermontreal@gmail.com> | 2017-03-21 00:01:33 +0300 |
commit | b643906752040b337eff1a91cf0fb7d4ba049e4a (patch) | |
tree | c982ea8bf0c6d360ee37feabd7e8116faac34b83 /app/Factories/LinkFactory.php | |
parent | 861665f4d778b4d4d675d48ead523f7e769551c9 (diff) |
Fix custom ending bug affecting non-truthy endings, update documentation for API error updates
Diffstat (limited to 'app/Factories/LinkFactory.php')
-rw-r--r-- | app/Factories/LinkFactory.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Factories/LinkFactory.php b/app/Factories/LinkFactory.php index 0e468e2..21a3bc7 100644 --- a/app/Factories/LinkFactory.php +++ b/app/Factories/LinkFactory.php @@ -55,14 +55,14 @@ class LinkFactory { looks like a shortened URL.'); } - if (!$is_secret && !$custom_ending && (LinkHelper::longLinkExists($long_url) !== false)) { + if (!$is_secret && (!isset($custom_ending)) && (LinkHelper::longLinkExists($long_url) !== false)) { // if link is not specified as secret, is non-custom, and // already exists in Polr, lookup the value and return $existing_link = LinkHelper::longLinkExists($long_url); return self::formatLink($existing_link); } - if ($custom_ending) { + if (isset($custom_ending)) { // has custom ending $ending_conforms = LinkHelper::validateEnding($custom_ending); if (!$ending_conforms) { |