summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-12-12 15:19:01 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-12-12 15:19:01 -0500
commit9557c7c8905f08361aabd1215fa3bc19badf9a4f (patch)
treeb9d3521c03c949b759be40823dbde4e5a660703c
parentf3735891cad0ca00f72ca4c68d444ca61382ad4b (diff)
move related code together
-rw-r--r--IkiWiki/Plugin/comments.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 6c8952d45..c458ea9da 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -391,10 +391,6 @@ sub sessioncgi ($$) { #{{{
IkiWiki::check_canedit($page, $cgi, $session);
$postcomment=0;
- my $editcontent = $form->field('editcontent') || '';
- $editcontent =~ s/\r\n/\n/g;
- $editcontent =~ s/\r/\n/g;
-
# FIXME: check that the wiki is locked right now, because
# if it's not, there are mad race conditions!
@@ -409,7 +405,6 @@ sub sessioncgi ($$) { #{{{
my $anchor = "${comments_pagename}${i}";
- $editcontent =~ s/"/\\"/g;
my $content = "[[!_comment format=$type\n";
# FIXME: handling of double quotes probably wrong?
@@ -446,6 +441,10 @@ sub sessioncgi ($$) { #{{{
$content .= " date=\"" . decode_utf8(strftime('%Y-%m-%dT%H:%M:%SZ', gmtime)) . "\"\n";
+ my $editcontent = $form->field('editcontent') || '';
+ $editcontent =~ s/\r\n/\n/g;
+ $editcontent =~ s/\r/\n/g;
+ $editcontent =~ s/"/\\"/g;
$content .= " content=\"\"\"\n$editcontent\n\"\"\"]]\n";
# This is essentially a simplified version of editpage: