Browse Source

* small fixes

master
Alex 'AdUser' Z 7 years ago
parent
commit
e88f5bc18e
  1. 2
      lib/CMTD/Helpers.pm
  2. 6
      lib/CMTD/Main.pm

2
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;

6
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",

Loading…
Cancel
Save