summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-12-14 07:36:19 +0000
committeralecpl <alec@alec.pl>2009-12-14 07:36:19 +0000
commit63ffe33c016e3f5a016d4ea961b12caa9c5b20c3 (patch)
tree20de863d443f9af6e222c2e5b21081c69c065400 /program/include
parent5b3ed54e84590bdb6efbfe3c79c5e0129486ef1a (diff)
- fix empty strings handling in rc_utf8_clean()
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_shared.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 547174b8a..fbab455c6 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -512,10 +512,10 @@ function rc_utf8_clean($input)
return $input;
// iconv/mbstring are much faster (especially with long strings)
- if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF8', 'UTF8')))
+ if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF8', 'UTF8')) !== false)
return $res;
- if (function_exists('iconv') && ($res = iconv('UTF8', 'UTF8//IGNORE', $input)))
+ if (function_exists('iconv') && ($res = iconv('UTF8', 'UTF8//IGNORE', $input)) !== false)
return $res;
$regexp = '/^('.
@@ -573,7 +573,7 @@ function rc_utf8_clean($input)
function json_serialize($input)
{
$input = rc_utf8_clean($input);
-
+
return json_encode($input);
}