X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/54f600af14bf6dc067ffc30ec6f22d517001fe99..e0ff81b48db087cc36e07a97db33e6af9411f64e:/IkiWiki/Plugin/moderatedcomments.pm?ds=inline

diff --git a/IkiWiki/Plugin/moderatedcomments.pm b/IkiWiki/Plugin/moderatedcomments.pm
index b0a328a06..5957833fc 100644
--- a/IkiWiki/Plugin/moderatedcomments.pm
+++ b/IkiWiki/Plugin/moderatedcomments.pm
@@ -19,7 +19,7 @@ sub getsetup () {
 		},
 		moderate_pagespec => {
 			type => 'pagespec',
-			example => 'user(http://*)',
+			example => '*',
 			description => 'PageSpec matching users or comment locations to moderate',
 			link => 'ikiwiki/PageSpec',
 			safe => 1,
@@ -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");
 	}