From c0853dcd535981178806c95b5a6a833f8eb49933 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 14 May 2009 08:03:40 +0200 Subject: [PATCH] [svn r20620] Quick-fix a bug in the encoding translation of social messages (see FS#4187) --- main/messages/message.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/messages/message.class.php b/main/messages/message.class.php index 82e54cc051..3137852c15 100755 --- a/main/messages/message.class.php +++ b/main/messages/message.class.php @@ -179,7 +179,10 @@ class MessageManager { } public static function send_message ($receiver_user_id, $title, $content) { - $table_message = Database::get_main_table(TABLE_MESSAGE); + global $charset; + $table_message = Database::get_main_table(TABLE_MESSAGE); + $title = mb_convert_encoding($title,$charset,'UTF-8'); + $content = mb_convert_encoding($content,$charset,'UTF-8'); //message in inbox $sql = "SELECT COUNT(*) as count FROM $table_message WHERE user_sender_id = ".api_get_user_id()." AND user_receiver_id='".Database::escape_string($receiver_user_id)."' AND title = '".Database::escape_string($title)."' AND content ='".Database::escape_string($content)."' "; $res_exist = api_sql_query($sql,__FILE__,__LINE__);