aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-06-05 19:51:54 +0000
committermistic100 <mistic@piwigo.org>2012-06-05 19:51:54 +0000
commit56cfd9b3acec2b2fa1efe304015b93038abce249 (patch)
tree9bac95b34ec1a046c94601a9f1a6c66678221a60
parentbf80d3f3bda8b88969180796128643bae51ff399 (diff)
bug:2645 author field is kept when comment not validated
git-svn-id: http://piwigo.org/svn/trunk@15570 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/picture_comment.inc.php6
-rw-r--r--themes/default/template/picture.tpl6
2 files changed, 7 insertions, 5 deletions
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php
index b6680aaf8..b4ae4c996 100644
--- a/include/picture_comment.inc.php
+++ b/include/picture_comment.inc.php
@@ -240,17 +240,19 @@ SELECT
if ($show_add_comment_form)
{
$key = get_ephemeral_key(3, $page['image_id']);
- $content = '';
+ $content = $author = '';
if ('reject'===@$comment_action)
{
$content = htmlspecialchars( stripslashes($comm['content']) );
+ $author = htmlspecialchars( stripslashes($comm['author']) );
}
$template->assign('comment_add',
array(
'F_ACTION' => $url_self,
'KEY' => $key,
'CONTENT' => $content,
- 'SHOW_AUTHOR' => !is_classic_user()
+ 'SHOW_AUTHOR' => !is_classic_user(),
+ 'AUTHOR' => $author ,
));
}
}
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl
index 1862fa35f..345d78b03 100644
--- a/themes/default/template/picture.tpl
+++ b/themes/default/template/picture.tpl
@@ -347,9 +347,9 @@ function togglePrivacyLevelBox()
<h4>{'Add a comment'|@translate}</h4>
<form method="post" action="{$comment_add.F_ACTION}" id="addComment">
{if $comment_add.SHOW_AUTHOR}
- <p><label>{'Author'|@translate} :</label></p>
- <p><input type="text" name="author"></p>
- <p><label>{'Comment'|@translate} :</label></p>
+ <p><label for="author">{'Author'|@translate} :</label></p>
+ <p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
+ <p><label for="contentid">{'Comment'|@translate} :</label></p>
{/if}
<p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
<p><input type="hidden" name="key" value="{$comment_add.KEY}">