]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/moderatedcomments.pm
factored out an urlabs from aggregate and cgi
[git.ikiwiki.info.git] / IkiWiki / Plugin / moderatedcomments.pm
index ff2c2b160a0bded7228384470b2be27f302d9cdd..5957833fc2de44dc20484f616f8813ff0306400b 100644 (file)
@@ -48,11 +48,11 @@ sub checkcontent (@) {
        }
 
        my $session=$params{session};
-       my $user=$session->param("name") if $session;
+       my $user=$session->param("name");
        if (pagespec_match($params{page}, $config{moderate_pagespec},
                        location => $params{page},
                        (defined $user ? (user => $user) : ()),
-                       (defined $ENV{REMOTE_ADDR} ? (ip => $ENV{REMOTE_ADDR}) : ()),
+                       (defined $session->remote_addr() ? (ip => $session->remote_addr()) : ()),
        )) {
                return gettext("comment needs moderation");
        }