From 5e5ea15db833ed42c883b22206ef2d3118a085e7 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 27 Jun 2004 08:51:05 +0000 Subject: [PATCH] fix. function is broken if it runs on string without html entities git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7694 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/encode/utf_8.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions/encode/utf_8.php b/functions/encode/utf_8.php index e788452e..d455e109 100644 --- a/functions/encode/utf_8.php +++ b/functions/encode/utf_8.php @@ -20,6 +20,10 @@ * @return a utf-8 encoded string [STRING] */ function charset_encode_utf_8 ($source) { + + // don't run though encoding function, if there is no encoded characters + if (! preg_match("'&#'",$source) ) return $source; + $utf8Str = ''; $entityArray = explode ("&#", $source); $size = count ($entityArray); -- 2.25.1