aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2022-08-17 07:09:56 +0200
committerDennis Eriksen <d@ennis.no>2022-08-17 07:09:56 +0200
commit544d037ba31bee5627b0006781e767508d26bec1 (patch)
treed3ec597b63a310c55bae22445cf07645e707f294
parentdefine value even if is undefined (diff)
downloadpurl-544d037ba31bee5627b0006781e767508d26bec1.tar.gz
keep generating new short if we get a matchHEADmaster
-rwxr-xr-xform.cgi5
1 files changed, 2 insertions, 3 deletions
diff --git a/form.cgi b/form.cgi
index 05bfbd6..1cb91e4 100755
--- a/form.cgi
+++ b/form.cgi
@@ -1,5 +1,5 @@
#!/bin/perl -wT
-# (c) 2019 Dennis Eriksen <https://dnns.no>
+# (c) 2019-2022 Dennis Eriksen <https://dnns.no>
use strict;
use warnings;
@@ -34,13 +34,12 @@ if ($q->param('url')) {
while (my $url = $dbh->selectrow_array($query, undef, $short)) {
$results .= "Your short exists. Generating new.<br>\n";
$short = genshort();
- last;
}
# Insert short and url into database
$query = qq(INSERT INTO shorts (url, short, created_by) VALUES (?, ?, ?););
my $sth = $dbh->prepare( $query );
- my $rv = $sth->execute($url, $short, $user) or die $sth->errstr;
+ $sth->execute($url, $short, $user) or die $sth->errstr;
$dbh->disconnect();