summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-25 20:39:04 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-25 20:39:04 +0000
commitb8a31dba9b95c78382bd85e3073ff8b129f53556 (patch)
tree3e7c89fce38c7700dcba46468b461ed72e818a57
parent56b35360eda1b2777da112c14ea2cc1efa0c1448 (diff)
downloadbrdo-b8a31dba9b95c78382bd85e3073ff8b129f53556.tar.gz
brdo-b8a31dba9b95c78382bd85e3073ff8b129f53556.tar.bz2
- Fixed a few tiny bugs in comment.inc (introduced by the form-ification).
-rw-r--r--includes/comment.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/comment.inc b/includes/comment.inc
index e7f14cb06..7cb59c781 100644
--- a/includes/comment.inc
+++ b/includes/comment.inc
@@ -115,14 +115,14 @@ function comment_post($edit) {
$duplicate = db_result(db_query("SELECT COUNT(cid) FROM comments WHERE pid = '". check_input($edit[pid]) ."' AND lid = '". check_input($edit[id]) ."' AND subject = '". check_input($edit[subject]) ."' AND comment = '". check_input($edit[comment]) ."'"), 0);
if ($duplicate != 0) {
- watchdog("warning", "comment: duplicate '$subject'");
+ watchdog("warning", "comment: duplicate '$edit[subject]'");
}
else {
// validate subject:
- $subject = ($subject) ? $subject : substr($comment, 0, 29);
+ $edit[subject] = $edit[subject] ? $edit[subject] : substr($edit[comment], 0, 29);
// add watchdog entry:
- watchdog("special", "comment: added '$subject'");
+ watchdog("special", "comment: added '$edit[subject]'");
// add comment to database:
db_query("INSERT INTO comments (lid, pid, author, subject, comment, hostname, timestamp, score) VALUES ('". check_input($edit[id]) ."', '". check_input($edit[pid]) ."', '$user->id', '". check_input($edit[subject]) ."', '". check_input($edit[comment]) ."', '". getenv("REMOTE_ADDR") ."', '". time() ."', '". ($user->userid ? 1 : 0) ."')");