Opened 3 years ago

Closed 3 years ago

#1486407 closed Bugs (fixed)

roundcube ui unresponsive (rc_utf8_clean issues)

Reported by: Technetux Owned by:
Priority: 5 Milestone: 0.4-beta
Component: User Interface Version: git-master
Severity: normal Keywords: ui unresponsive utf8
Cc:

Description

Hi!

This problem appears to be caused by changeset 3175 and what I think to be a couple bugs in rc_utf8_clean.

If the ui is responsive for you, I assume you have the extension mbstring enabled on your system.

If my tests are conclusive, the ui should be unresponsive if you do not have mbstring enabled. rc_utf8_clean has two alternatives for those who do not have mbstring enabled, iconv and its own cleaning routine. iconv probably won't work because it is expecting 'UTF-8' as opposed to 'UTF8' in its arguments. The function's own cleaning routine will fail because it consistently cuts off the last character of the input string.

Here is a possible patch:

Index: program/include/rcube_shared.inc
===================================================================
--- program/include/rcube_shared.inc    (revision 3194)
+++ program/include/rcube_shared.inc    (working copy)
@@ -518,7 +518,7 @@
   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)) !== false)
+  if (function_exists('iconv') && ($res = iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)
     return $res;

   $regexp = '/^('.
@@ -536,7 +536,7 @@
   $seq = '';
   $out = '';

-  for ($i = 0, $len = strlen($input)-1; $i < $len; $i++) {
+  for ($i = 0, $len = strlen($input); $i < $len; $i++) {
     $chr = $input[$i];
     $ord = ord($chr);
     // 1-byte character

Thank you!
Ryan

Change History (3)

comment:1 Changed 3 years ago by alec

  • Milestone changed from later to 0.4-beta

I'm not sure about what you're talking about iconv. Check iconv -l | grep UTF it returns UTF8 and UTF-8 here.

comment:2 Changed 3 years ago by Technetux

Interesting, for me it returns only hyphenated UTFs:

UTF-8
UTF-16
UTF-16BE
UTF-16LE
UTF-32
UTF-32BE
UTF-32LE
UNICODE-1-1-UTF-7 UTF-7 CSUNICODE11UTF7

comment:3 Changed 3 years ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Ok, fixed in [6481d4bb].

Note: See TracTickets for help on using tickets.