>>> 100% CPU load after clicking the "Submit" button?? Do you mean after
>>> you click "Submit" and go to the INBOX message list? Or do you really
>>> mean the Display Options page "Submit" button locked up the server??
>> while() cycle in sm_truncate_string() assumes that strpos/mb_strpos
>> to next symbol. In some conditions (mbstring + raw gb2313 text + utf-8
>> charset used by translation + some PHP version, at least 5.3.13)
> I think you mean 5.2.13
>> it does not
>> advance. If you want better explanation, I can split that string into
>> codes and try to find what is specific in position which locks the
> What do you mean by "does not advance?" i.e., mb_strpos($haystack,
> $needle, $offset, $charset) === $offset? If I fake this condition by
> returning $offset from sq_strpos(), this still won't create an
> infinite loop, because eventually the entity start position variable
> is incremented beyond the allowable maximum character count.
> However, if mb_strpos() is returning 0 (zero) instead of FALSE as it
> should, this *does* create an infinite loop. I have uploaded a new
> patch for this condition to the tracker I previously mentioned.
mb_strpos returns position which is smaller than offset, but it is not
zero or boolean false. Reported position does not contain character
defined in $needle. First amp is reported correctly (position = 3), second
one is reported with -8 or -10 mistake (20 or 22 instead of 30). It is not
specific to one PHP version. & position is not reported correctly in 5.2.0
(debian etch), 5.2.13 (standard php package) and 5.3.2 (debian squeeze).
5.2.0 should not put while() into infinite loop, because reported ;
position is higher than real & position.
Attached test script and test results. Can't see options for attaching
files on SF tracker. Will try to reduce test script to something suitable
for PHP bug tracker.