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(), date => time(),
name => $cm->{name}, name => $cm->{name},
reply => $cm->{reply}, reply => $cm->{reply},
email => $cm->{mail} || '', email => $cm->{email},
text => b64_encode($cm->{text}), text => b64_encode($cm->{text}),
}); });
$self->app->db->commit; $self->app->db->commit;

6
lib/CMTD/Main.pm

@ -16,7 +16,7 @@ sub captcha {
my ($self) = @_; my ($self) = @_;
eval { eval {
my $table = $c->app->config->{captcha}->{table}; my $table = $self->app->config->{captcha}->{table};
my @sort = qw(shown tries); my @sort = qw(shown tries);
$self->app->db->begin; $self->app->db->begin;
my ($cid, $data) = $self->app->db->select($table, ['id', 'data'], undef, \@sort)->list; my ($cid, $data) = $self->app->db->select($table, ['id', 'data'], undef, \@sort)->list;
@ -45,7 +45,7 @@ sub c_list {
eval { eval {
if (my $sid = $self->app->sid_by_name($ref->{site})) { if (my $sid = $self->app->sid_by_name($ref->{site})) {
my @cm = (); 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); my @tm = $self->app->comments_by_pid($pid);
# TODO: processing # TODO: processing
@cm = @tm; @cm = @tm;
@ -54,7 +54,7 @@ sub c_list {
} else { } else {
$self->res->code(400); $self->res->code(400);
$self->render(text => "no such site\n"); $self->render(text => "no such site\n");
} } 1;
} or do { } or do {
chomp $@; chomp $@;
my $msg = sprintf "Error when listing comments for %s/%s: %s", my $msg = sprintf "Error when listing comments for %s/%s: %s",

Loading…
Cancel
Save