From b643906752040b337eff1a91cf0fb7d4ba049e4a Mon Sep 17 00:00:00 2001 From: Chaoyi Zha Date: Mon, 20 Mar 2017 17:01:33 -0400 Subject: Fix custom ending bug affecting non-truthy endings, update documentation for API error updates --- app/Factories/LinkFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Factories/LinkFactory.php') 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) { -- cgit v1.2.3