From e88f5bc18efdd4576e4a55a775f4efa71d0537a5 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Wed, 23 Aug 2017 11:09:21 +1000 Subject: [PATCH] * small fixes --- lib/CMTD/Helpers.pm | 2 +- lib/CMTD/Main.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CMTD/Helpers.pm b/lib/CMTD/Helpers.pm index 994f25c..064123a 100644 --- a/lib/CMTD/Helpers.pm +++ b/lib/CMTD/Helpers.pm @@ -91,7 +91,7 @@ sub register { date => time(), name => $cm->{name}, reply => $cm->{reply}, - email => $cm->{mail} || '', + email => $cm->{email}, text => b64_encode($cm->{text}), }); $self->app->db->commit; diff --git a/lib/CMTD/Main.pm b/lib/CMTD/Main.pm index 1df0156..0577d31 100644 --- a/lib/CMTD/Main.pm +++ b/lib/CMTD/Main.pm @@ -16,7 +16,7 @@ sub captcha { my ($self) = @_; eval { - my $table = $c->app->config->{captcha}->{table}; + my $table = $self->app->config->{captcha}->{table}; my @sort = qw(shown tries); $self->app->db->begin; my ($cid, $data) = $self->app->db->select($table, ['id', 'data'], undef, \@sort)->list; @@ -45,7 +45,7 @@ sub c_list { eval { if (my $sid = $self->app->sid_by_name($ref->{site})) { my @cm = (); - if (my $pid = $self->app->pid_by_hash($sid, $hash)) { + if (my $pid = $self->app->pid_by_hash($sid, $ref->{hash})) { my @tm = $self->app->comments_by_pid($pid); # TODO: processing @cm = @tm; @@ -54,7 +54,7 @@ sub c_list { } else { $self->res->code(400); $self->render(text => "no such site\n"); - } + } 1; } or do { chomp $@; my $msg = sprintf "Error when listing comments for %s/%s: %s",