Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv15488
Modified Files:
comment.php
Log Message:
Disable empty comments
Index: comment.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/comment.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- comment.php 28 Apr 2003 17:46:50 -0000 1.3
+++ comment.php 1 May 2003 13:09:25 -0000 1.4
@@ -51,15 +51,19 @@
} else {
$remember = 0;
$comment['url'] = $serendipity['POST']['url'];
- $comment['comment'] = $serendipity['POST']['comment'];
+ $comment['comment'] = trim($serendipity['POST']['comment']);
$comment['name'] = $serendipity['POST']['name'];
$comment['email'] = $serendipity['POST']['email'];
- serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL');
+ if ( !empty($comment['comment']) ) {
+ serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL');
?>
Your comment was successfully added. Click <a href="<?=$PHP_SELF?>?serendipity[entry_id]=<?=$serendipity['POST']['entry_id']?>">here</a> to return to
the comments, and <a href="#" onClick="self.close()">here</a> to close this window.
-<?php } ?>
+<?php } else { ?>
+Your comment did not contain anything, please <a href="#" onClick="history.go(-1)">go back</a> and try again
+<?php }
+} ?>
</body>
</html>
<?php
|