fix. function is broken if it runs on string without html entities
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jun 2004 08:51:05 +0000 (08:51 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jun 2004 08:51:05 +0000 (08:51 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7694 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/encode/utf_8.php

index e788452ef58a705cf2e368546332b8adac6b624a..d455e1096e9979d97e9dd6de2e86465477e29ee8 100644 (file)
  * @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);