diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-06-27 18:06:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-06-27 18:06:36 +0000 |
commit | 124694ee4dbcc1df5dfc2d419ed2393619883071 (patch) | |
tree | 907a5fb1f31991f338a9bef2f4af8dbde515f5c2 | |
parent | df30ccb06109a7bcd9a4d830aba696a79f1511b4 (diff) | |
download | brdo-124694ee4dbcc1df5dfc2d419ed2393619883071.tar.gz brdo-124694ee4dbcc1df5dfc2d419ed2393619883071.tar.bz2 |
- Fixed bug node.module bug:
+ the node scheduler did not un-schedule a node!
- Fixed comment bugs (as a result of the formification):
+ no signatures where being attached to the comments.
+ check_input was used where is should have been check_output,
with broken filters as the immediate result.
-rw-r--r-- | includes/comment.inc | 11 | ||||
-rw-r--r-- | modules/calendar.module | 8 | ||||
-rw-r--r-- | modules/node.module | 4 | ||||
-rw-r--r-- | modules/node/node.module | 4 |
4 files changed, 14 insertions, 13 deletions
diff --git a/includes/comment.inc b/includes/comment.inc index 68b4ae977..9bbc0c259 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -32,7 +32,8 @@ function comment_moderate($moderate) { foreach ($moderate as $id=>$vote) { if ($vote != $comment_votes[$none]) { - $id = check_input($id); $vote = check_input($vote); + $id = check_output($id); + $vote = check_output($vote); $comment = db_fetch_object(db_query("SELECT * FROM comments WHERE cid = '$id'")); if ($comment && !field_get($comment->users, $user->userid)) { $result = db_query("UPDATE comments SET score = score $vote, votes = votes + 1, users = '". field_set($comment->users, $user->userid, $vote) ."' WHERE cid = '$id'"); @@ -54,14 +55,14 @@ function comment_form($edit) { $form .= form_item(t("Your name"), format_username($user->userid)); // subject field: - $form .= form_textfield(t("Subject"), "subject", check_input($edit[subject]), 50, 60); + $form .= form_textfield(t("Subject"), "subject", check_output($edit[subject]), 50, 60); // comment field: - $form .= form_textarea(t("Comment"), "comment", check_input($edit[comment]), 50, 10, t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", ""))); + $form .= form_textarea(t("Comment"), "comment", check_output($edit[comment] ? $edit[comment] : $user->signature), 50, 10, t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", ""))); // preview button: - $form .= form_hidden("pid", check_input($edit[pid])); - $form .= form_hidden("id", check_input($edit[id])); + $form .= form_hidden("pid", check_output($edit[pid])); + $form .= form_hidden("id", check_output($edit[id])); if (!$edit[comment]) { $form .= form_submit(t("Preview comment")); diff --git a/modules/calendar.module b/modules/calendar.module index e60e47dc2..93c6c0ae9 100644 --- a/modules/calendar.module +++ b/modules/calendar.module @@ -17,7 +17,7 @@ class Calendar { // Extract today's date: $today = mktime(23, 59, 59, date("n", time()), date("d", time()), date("Y", time())); - + // Extract the timestamp of the last day of today's month: $thislast = mktime(23, 59, 59, date("n", time()), date("t", time()), date("Y", time())); @@ -32,12 +32,12 @@ class Calendar { $prev = mktime(23, 59, 59, $month - 1, min(date("t", $prevmonth), $day), $year); $nextmonth = mktime(23, 59, 59, $month + 1, 1, $year); $next = mktime(23, 59, 59, $month + 1, min(date("t", $nextmonth), $day), $year); - - // Generate calendar header: + + // Generate calendar header: $output .= "\n<!-- calendar -->\n"; $output .= "<TABLE WIDTH=\"100%\" BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"1\">\n"; $output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"7\"><SMALL><A HREF=\"index.php?date=$prev\"><</A> ". date("F Y", $this->date) ." " . ($next <= $thislast ? "<A HREF=\"index.php?date=$next\">></A>" : ">") . "</SMALL></TD></TR>\n"; - + // Generate the days of the week: $output .= " <TR>"; $somesunday = mktime(0, 0, 0, 3, 20, 1994); diff --git a/modules/node.module b/modules/node.module index 92bf70690..7bc148177 100644 --- a/modules/node.module +++ b/modules/node.module @@ -65,8 +65,8 @@ function node_filter($text) { function node_cron() { db_query("UPDATE node SET status = '". node_status("posted") ."', timestamp_posted = '' WHERE timestamp_posted > 0 AND timestamp_posted < ". time()); - db_query("UPDATE node SET status = '". node_status("queued") ."', timestamp_posted = '' WHERE timestamp_queued > 0 AND timestamp_queued < ". time()); - db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_posted = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); + db_query("UPDATE node SET status = '". node_status("queued") ."', timestamp_queued = '' WHERE timestamp_queued > 0 AND timestamp_queued < ". time()); + db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_hidden = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); } function node_link($nid, $type) { diff --git a/modules/node/node.module b/modules/node/node.module index 92bf70690..7bc148177 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -65,8 +65,8 @@ function node_filter($text) { function node_cron() { db_query("UPDATE node SET status = '". node_status("posted") ."', timestamp_posted = '' WHERE timestamp_posted > 0 AND timestamp_posted < ". time()); - db_query("UPDATE node SET status = '". node_status("queued") ."', timestamp_posted = '' WHERE timestamp_queued > 0 AND timestamp_queued < ". time()); - db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_posted = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); + db_query("UPDATE node SET status = '". node_status("queued") ."', timestamp_queued = '' WHERE timestamp_queued > 0 AND timestamp_queued < ". time()); + db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_hidden = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); } function node_link($nid, $type) { |