From 0ff3231643fa0d79ae5c68bd11c93db05b11f73c Mon Sep 17 00:00:00 2001 From: dawnlinux Date: Mon, 6 Sep 2004 03:53:00 +0000 Subject: [PATCH] Fix the bug: Fail to create text files that contain multibyte characters in filemanager, for exmaple, files that contain Chinese characters. Reason for producing the bug: One parameter of "fwrite" is "strlen ($data['content'])". To multibyte character, "strlen" can not return its actual length. So "fwrite" cannot write all characters to the created file. --- phpgwapi/inc/class.vfs_sql.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.vfs_sql.inc.php b/phpgwapi/inc/class.vfs_sql.inc.php index ced2e6f50f..136aa699cb 100644 --- a/phpgwapi/inc/class.vfs_sql.inc.php +++ b/phpgwapi/inc/class.vfs_sql.inc.php @@ -902,7 +902,7 @@ { if ($fp = fopen ($p->real_full_path, 'wb')) { - fwrite ($fp, $data['content'], strlen ($data['content'])); + fwrite ($fp, $data['content']); fclose ($fp); $write_ok = 1; }