Skip to content

Commit

Permalink
Calling getUser() without params means six way join. This is stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianAker committed Apr 5, 2002
1 parent b9fb0ad commit e302a74
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions themes/slashcode/htdocs/comments.pl
Expand Up @@ -1224,13 +1224,19 @@ sub moderateCid {

# Adjust comment posters karma and moderation stats.
if ($comment->{uid} != $constants->{anonymous_coward_uid}) {
my $cuser = $slashdb->getUser($comment->{uid});
my $cuser = $slashdb->getUser($comment->{uid}, [ qw| downmods upmods karma | ]);
my $newkarma = $cuser->{karma} + $val;
$cuser->{downmods}++ if $val < 0;
$cuser->{upmods}++ if $val > 0;
$cuser->{karma} = $newkarma
if $newkarma <= $constants->{maxkarma} &&
$newkarma >= $constants->{minkarma};
if ($val < 0) {
$cuser->{karma} = $newkarma;
} else {
$cuser->{karma} = $newkarma
if $newkarma <= $constants->{maxkarma};
}
$cuser->{karma} = $constants->{minkarma}
if $newkarma < $constants->{minkarma};

$slashdb->setUser($comment->{uid}, {
karma => $cuser->{karma},
upmods => $cuser->{upmods},
Expand Down

0 comments on commit e302a74

Please sign in to comment.