From a083daf8418d1dc6e0cbc5b41924c9d364815f9e Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Thu, 15 Apr 2004 14:07:08 +0000 Subject: Truncate UTF-8 patch. Introduced a new function truncate_utf8() for chopping off strings at unsure locations, without risking incomplete UTF-8 data. --- modules/aggregator.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/aggregator.module') 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)); } /* -- cgit v1.2.3