Commit 124694ee authored by Dries's avatar Dries

- 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.
parent df30ccb0
......@@ -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"));
......
......@@ -17,7 +17,7 @@ function display() {
// 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 @@ function display() {
$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\">&lt;</A> &nbsp; ". date("F Y", $this->date) ." &nbsp; " . ($next <= $thislast ? "<A HREF=\"index.php?date=$next\">&gt;</A>" : "&gt;") . "</SMALL></TD></TR>\n";
// Generate the days of the week:
$output .= " <TR>";
$somesunday = mktime(0, 0, 0, 3, 20, 1994);
......
......@@ -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) {
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment