diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-04-15 14:07:08 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-04-15 14:07:08 +0000 |
commit | a083daf8418d1dc6e0cbc5b41924c9d364815f9e (patch) | |
tree | d2bd8288eb65db1e741043e451f2cc1c20d2d093 /modules/comment.module | |
parent | 803dacf65225d78c2ffe60a853b1c822f4e628e1 (diff) | |
download | brdo-a083daf8418d1dc6e0cbc5b41924c9d364815f9e.tar.gz brdo-a083daf8418d1dc6e0cbc5b41924c9d364815f9e.tar.bz2 |
Truncate UTF-8 patch. Introduced a new function truncate_utf8() for chopping off strings at unsure locations, without risking incomplete UTF-8 data.
Diffstat (limited to 'modules/comment.module')
-rw-r--r-- | modules/comment.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/comment.module b/modules/comment.module index 03f6144bd..24e2a232b 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -277,7 +277,7 @@ function comment_post($edit) { $edit["subject"] = strip_tags($edit["subject"]); if ($edit["subject"] == "") { - $edit["subject"] = substr(strip_tags($edit["comment"]), 0, 29); + $edit["subject"] = truncate_utf8(strip_tags($edit["comment"]), 29); } /* @@ -978,7 +978,7 @@ function comment_admin_overview($status = 0) { $result = pager_query($sql, 50); while ($comment = db_fetch_object($result)) { - $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128))), NULL, "comment-$comment->cid") ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); + $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid", array("title" => htmlspecialchars(truncate_utf8($comment->comment, 128))), NULL, "comment-$comment->cid") ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); } if ($pager = theme("pager", NULL, 50, 0, tablesort_pager())) { |