Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cydrobolt/polr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaoyi Zha <summermontreal@gmail.com>2017-03-21 00:01:33 +0300
committerChaoyi Zha <summermontreal@gmail.com>2017-03-21 00:01:33 +0300
commitb643906752040b337eff1a91cf0fb7d4ba049e4a (patch)
treec982ea8bf0c6d360ee37feabd7e8116faac34b83 /app/Factories/LinkFactory.php
parent861665f4d778b4d4d675d48ead523f7e769551c9 (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.php4
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) {