From a1b158334a4f2362caa5186f81b41c7cc32011a5 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 8 Mar 2001 19:30:41 +0000 Subject: [PATCH] - more small improvements --- includes/comment.inc | 5 +---- includes/function.inc | 2 +- modules/diary.module | 7 ++----- story.php | 2 +- submit.php | 8 ++------ 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/includes/comment.inc b/includes/comment.inc index 9dc3f557006..744ab0f9b97 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -59,7 +59,7 @@ function comment_reply($pid, $id) { $pid = 0; if ($link == "story") { $item = db_fetch_object(db_query("SELECT stories.*, users.userid FROM stories LEFT JOIN users ON stories.author = users.id WHERE stories.status != 0 AND stories.id = '$id'")); - $theme->story($item, ""); + $theme->story($item, "[ ". t("reply to this story") ." ]"); } } @@ -93,9 +93,6 @@ function comment_reply($pid, $id) { function comment_preview($pid, $id, $subject, $comment) { global $allowed_html, $link, $REQUEST_URI, $theme, $user; - $subject = check_output($subject); - $comment = check_output($comment); - // Preview comment: comment_view(new Comment($user->userid, $subject, $comment, time(), $user->url, $user->fake_email, 0, 0, 0, 0), t("reply to this comment")); diff --git a/includes/function.inc b/includes/function.inc index 0308a5efc91..1b206c50080 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -88,7 +88,7 @@ function format_email($address) { function format_url($address, $description = "") { global $na; $description = ($description) ? $description : $address; - return ($address) ? "$description" : $na; + return ($address) ? "". check_output($description) ."" : $na; } ?> diff --git a/modules/diary.module b/modules/diary.module index 2996cc6a026..2e1cd7e7b69 100644 --- a/modules/diary.module +++ b/modules/diary.module @@ -143,9 +143,6 @@ function diary_page_edit($id) { function diary_page_preview($text, $timestamp, $id = 0) { global $theme, $user, $allowed_html; - $text = ($text) ? check_output($text) : ""; - $timestamp = ($timestamp) ? check_output($timestamp) : ""; - $output .= diary_page_entry($timestamp, $text); $output .= "
\n"; @@ -205,8 +202,8 @@ function diary_page() { diary_page_display(check_input($name)); break; case "Preview diary entry": - if ($id) diary_page_preview(check_input($text), check_input($timestamp), check_input($id)); - else diary_page_preview(check_input($text), time()); + if ($id) diary_page_preview(($text ? check_output($text) : ""), check_input($timestamp), check_input($id)); + else diary_page_preview(($text ? check_output($text) : ""), time()); break; case "Submit diary entry": if ($id) diary_page_submit(check_input($text), check_input($id)); diff --git a/story.php b/story.php index 971eb9f1196..9d2f3115193 100644 --- a/story.php +++ b/story.php @@ -20,7 +20,7 @@ function story_render($id, $cid) { switch($op) { case t("Preview comment"): $theme->header(); - comment_preview(check_input($pid), check_input($id), check_input($subject), check_input($comment)); + comment_preview(check_input($pid), check_input($id), ($subject ? check_output($subject) : ""), ($comment ? check_output($comment) : "")); $theme->footer(); break; case t("Post comment"): diff --git a/submit.php b/submit.php index 87b441ea0d0..1c01b73d3de 100644 --- a/submit.php +++ b/submit.php @@ -46,10 +46,6 @@ function submit_preview($subject, $abstract, $article, $section) { include "includes/story.inc"; - $subject = ($subject) ? check_output($subject) : ""; - $article = ($article) ? check_output($article) : ""; - $abstract = ($abstract) ? check_output($abstract) : ""; - $output .= "\n"; $output .= "". t("Your name") .":
\n"; @@ -91,7 +87,7 @@ function submit_preview($subject, $abstract, $article, $section) { $output .= "
\n"; $theme->header(); - $theme->story(new Story($user->userid, $subject, $abstract, $article, $section, time())); + $theme->story(new Story($user->userid, $subject, $abstract, $article, $section, time()), "[ ". t("reply to this story") ." ]"); $theme->box(t("Submit a story"), $output); $theme->footer(); } @@ -113,7 +109,7 @@ function submit_submit($subject, $abstract, $article, $section) { switch($op) { case t("Preview submission"): - submit_preview(check_input($subject), check_input($abstract), check_input($article), check_input($section)); + submit_preview(($subject ? check_output($subject) : ""), ($abstract ? check_output($abstract) : ""), ($article ? check_output($article) : ""), check_output($section)); break; case t("Submit submission"): submit_submit(check_input($subject), check_input($abstract), check_input($article), check_input($section));