diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator.module | 2 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 2 | ||||
-rw-r--r-- | modules/comment.module | 4 | ||||
-rw-r--r-- | modules/comment/comment.module | 4 | ||||
-rw-r--r-- | modules/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/watchdog.module | 2 | ||||
-rw-r--r-- | modules/watchdog/watchdog.module | 2 |
8 files changed, 10 insertions, 10 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module index 331387cfa..8b78b71fd 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -397,7 +397,7 @@ function aggregator_parse_feed(&$data, $feed) { $title = $item["TITLE"]; } else { - $title = preg_replace('/^(.*)[^\w;&].*?$/', "\\1", substr($item["DESCRIPTION"], 0, 40)); + $title = preg_replace('/^(.*)[^\w;&].*?$/', "\\1", truncate_utf8($item["DESCRIPTION"], 40)); } /* diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 331387cfa..8b78b71fd 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -397,7 +397,7 @@ function aggregator_parse_feed(&$data, $feed) { $title = $item["TITLE"]; } else { - $title = preg_replace('/^(.*)[^\w;&].*?$/', "\\1", substr($item["DESCRIPTION"], 0, 40)); + $title = preg_replace('/^(.*)[^\w;&].*?$/', "\\1", truncate_utf8($item["DESCRIPTION"], 40)); } /* 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())) { diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 03f6144bd..24e2a232b 100644 --- a/modules/comment/comment.module +++ b/modules/comment/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())) { diff --git a/modules/node.module b/modules/node.module index c9392f776..bb487e077 100644 --- a/modules/node.module +++ b/modules/node.module @@ -213,7 +213,7 @@ function node_teaser($body) { ** Nevermind, we split it the hard way ... */ - return substr($body, 0, $size); + return truncate_utf8($body, $size); } diff --git a/modules/node/node.module b/modules/node/node.module index c9392f776..bb487e077 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -213,7 +213,7 @@ function node_teaser($body) { ** Nevermind, we split it the hard way ... */ - return substr($body, 0, $size); + return truncate_utf8($body, $size); } diff --git a/modules/watchdog.module b/modules/watchdog.module index a7ed775a8..e0b1c38d2 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -94,7 +94,7 @@ function watchdog_overview($type) { while ($watchdog = db_fetch_object($result)) { $rows[] = array( array("data" => format_date($watchdog->timestamp, "small"), "class" => "watchdog-$watchdog->type"), - array("data" => substr(strip_tags($watchdog->message), 0, 64), "class" => "watchdog-$watchdog->type"), + array("data" => truncate_utf8(strip_tags($watchdog->message), 64), "class" => "watchdog-$watchdog->type"), array("data" => format_name($watchdog), "class" => "watchdog-$watchdog->type"), array("data" => $watchdog->link, "class" => "watchdog-$watchdog->type"), array("data" => l(t("view details"), "admin/watchdog/view/$watchdog->wid"), "class" => "watchdog-$watchdog->type") diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index a7ed775a8..e0b1c38d2 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -94,7 +94,7 @@ function watchdog_overview($type) { while ($watchdog = db_fetch_object($result)) { $rows[] = array( array("data" => format_date($watchdog->timestamp, "small"), "class" => "watchdog-$watchdog->type"), - array("data" => substr(strip_tags($watchdog->message), 0, 64), "class" => "watchdog-$watchdog->type"), + array("data" => truncate_utf8(strip_tags($watchdog->message), 64), "class" => "watchdog-$watchdog->type"), array("data" => format_name($watchdog), "class" => "watchdog-$watchdog->type"), array("data" => $watchdog->link, "class" => "watchdog-$watchdog->type"), array("data" => l(t("view details"), "admin/watchdog/view/$watchdog->wid"), "class" => "watchdog-$watchdog->type") |