6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
9/2/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#6660] Fatal error with very big strings conversion
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. ,.__.. .. . | | \./ [__]|\ || | |__| | | || \||/\|
Comment
> Hello, > > > > I got a problem today with a very big text mail (~4Mo) due to an > infinite loop in a log deamon. This causes my whole mailbox page to > crash with an PHP Fatal error: > > > > PHP Fatal error: Allowed memory size of 33554432 bytes exhausted > (tried to allocate 16187725 bytes) in > /usr/share/horde3/lib/Horde/String.php on line 128 > > > > I managed to prevent the error with the following hack: > > > > /* HACK by Elektordi 2008-04-28: Prevent crashs caused by > very big text mails */ > > if(strlen($input)>1048576 && String::extensionExists('mbstring')) { > > return @mb_convert_encoding($input, $to, $from); > > } > > > > in file String.php and function _convertCharset, just before the line > /* Use utf8_[en|de]code() if possible. */ > > > > I did this because Mbstring seems to allocate much less memory than > utf8_xxcode functions. But a better test in the "if" is to check the > free memory instead of using the constant 1048576 (=1024*1024) > > > > Hope this will help you! > > > > Regards, > > > > Elektordi
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers