summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-01-02 18:34:13 +0000
committerDries Buytaert <dries@buytaert.net>2003-01-02 18:34:13 +0000
commit2b5dfdafa51f92e074d96ca249039f59b5bdc1a6 (patch)
treeeb8548b6c3170e6893ebaa7d948e28408a79a64b /modules
parenta728900dbab10899ed4acc7704ba5a66428483a1 (diff)
downloadbrdo-2b5dfdafa51f92e074d96ca249039f59b5bdc1a6.tar.gz
brdo-2b5dfdafa51f92e074d96ca249039f59b5bdc1a6.tar.bz2
Bugfix: when we have to extract a comment's title from the comment's body,
first strip the body's HTML tags or we might get an empty title after all.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment.module6
-rw-r--r--modules/comment/comment.module6
2 files changed, 10 insertions, 2 deletions
diff --git a/modules/comment.module b/modules/comment.module
index d27f36d7d..b4f1971ec 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -200,7 +200,11 @@ function comment_post($edit) {
** one from the comment's body.
*/
- $edit["subject"] = strip_tags(($edit["subject"] ? $edit["subject"] : substr($edit["comment"], 0, 29)));
+ $edit["subject"] = strip_tags($edit["subject"]);
+
+ if ($edit["subject"] == "") {
+ $edit["subject"] = substr(strip_tags($edit["comment"]), 0, 29);
+ }
/*
** Validate the comment's body.
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index d27f36d7d..b4f1971ec 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -200,7 +200,11 @@ function comment_post($edit) {
** one from the comment's body.
*/
- $edit["subject"] = strip_tags(($edit["subject"] ? $edit["subject"] : substr($edit["comment"], 0, 29)));
+ $edit["subject"] = strip_tags($edit["subject"]);
+
+ if ($edit["subject"] == "") {
+ $edit["subject"] = substr(strip_tags($edit["comment"]), 0, 29);
+ }
/*
** Validate the comment's body.