6.0.0-beta1
7/5/25

[#10618] IMP - error logged for htmlspecialchars
Summary IMP - error logged for htmlspecialchars
Queue Horde Groupware Webmail Edition
Queue Version 4.0.3
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester horde (at) agotnes (dot) com
Created 10/08/2011 (5019 days ago)
Due
Updated 10/18/2011 (5009 days ago)
Assigned 10/10/2011 (5017 days ago)
Resolved 10/18/2011 (5009 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/18/2011 05:24:32 AM Michael Slusarz Comment #7
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
The locale of the server is irrelevant... since the locale will be 
dynamically changed based on the user's language selection.

So you have at least one user using a locale that uses a multibyte 
thousands/decimal separator.

This is due to a PHP bug, and has been worked around as of IMP 5.0.14.
10/18/2011 05:22:54 AM Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10618: Workaround broken number_format() for PHP < 5.4.0

  5 files changed, 37 insertions(+), 17 deletions(-)
http://git.horde.org/horde-git/-/commit/122e04a55e1a452408764460bd22b2d345121c11
10/16/2011 11:08:44 AM horde (at) agotnes (dot) com Comment #5 Reply to this comment
System Locale information;

locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

I couldn't find anything locale related for either Horde or PHP (from 
test.php / phpinfo) - if you let me know where to look I'm happy to... 
This only seems to happen for some messages - not all of them, so 
quite strange... I'm also happy to put in more debugging if you wish - 
let me know what&where :)
10/11/2011 03:52:44 AM Michael Slusarz Comment #4 Reply to this comment
Oct 10 14:29:16 skadi HORDE4: [imp] 1?019 KB [pid 21452 on line 449 
of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]
Oct 10 14:29:16 skadi HORDE4: [imp] PHP ERROR: htmlspecialchars(): 
Invalid multibyte sequence in argument [pid 21452 on line 450 of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]
What is the thousands separator in the locale you are using?  Is it a 
multibyte character?  If so, I think we are running into a bug with 
number_format() - according to documentation, before PHP 5.4, only the 
first character of a separator is used.  Thus, if a multibyte 
character is being used, it will be chopped off after the first byte.
10/10/2011 12:34:51 PM horde (at) agotnes (dot) com Comment #3 Reply to this comment
Thought you might say that - I've had a hunt around and found the 
source of the issue - not sure providing the source of the message 
will help but let me know based on this;

I added a bit of logging and found that this occurs when the user 
opens their inbox, i.e. in listing the messages. One of the messages 
has no 'size' information for the message which causes the issue when 
viewed in DIMP and the following comes up in the log, note the 
offending second line which likely contains a comma?;

I had a look and the message looks fine - anything further such as a 
copy of the message? It is only a picture attached to an otherwise 
empty email...

Oct 10 14:29:16 skadi HORDE4: [imp] 1,1 MB [pid 21452 on line 449 of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]
Oct 10 14:29:16 skadi HORDE4: [imp] 1?019 KB [pid 21452 on line 449 of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]
Oct 10 14:29:16 skadi HORDE4: [imp] PHP ERROR: htmlspecialchars(): 
Invalid multibyte sequence in argument [pid 21452 on line 450 of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]
Oct 10 14:29:16 skadi HORDE4: [imp] 815 KB [pid 21452 on line 449 of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]
10/10/2011 04:30:26 AM Michael Slusarz Comment #2
State ⇒ Feedback
Reply to this comment
My guess is that the error is being thrown when trying to display a 
message with broken encoding.  In other words, it is safely ignored.

Only way we can track this down further is if you can provide a sample 
message that triggers this error.
10/08/2011 12:54:48 AM horde (at) agotnes (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ IMP - error logged for htmlspecialchars
Queue ⇒ Horde Groupware Webmail Edition
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
I get this error in my log file, not sure how to tie it back to a 
specific user/email message but my users are using international 
character sets (Norwegian);

HORDE4: [imp] PHP ERROR: htmlspecialchars(): Invalid multibyte 
sequence in argument [pid 16678 on line 449 of 
"/var/www/www.agotnes.com/htdocs/horde4/imp/lib/Views/ListMessages.php"]

happy to help debug further with some pointers as to where to start.

IMP5.0.13, Horde 4.0.9

Saved Queries