Interesting. The in the live environment I just get a blank screen instead of a warning message. Man, what a headache.
You mean that you get a blank page when the warning triggers and you get it by email ? And the rest of the time the page displays correctly ?
It's weird because my pages always display correctly, even when a warning triggers.
I've never gotten my page to display. It throws the warning in dev mode and a blank page in live mode. Checked the error logs and everything. There are no fatal errors. Agh..
To avoid this problem, you could try to replace :
$shiftCount = substr_count($pattern, '/', 0, $doubleSlashPoint) + 1;
$shiftCount = substr_count( array_shift( split('(//)', $pattern ) ), '/' ) + 1;
On line 303 in sapphire/core/control/HTTPRequest.php
Because my site still works properly, I'm looking for a better solution to this issue.
Well. My host's technical service has been actively looking for a solution but with no success :/
So, for now, I'm using the HTTPRequest.php code modification to avoid the issue.
This fix is partial :/
I forgot the mb_ereg_replace problem.
For some reason it didn't cause me any "visual" trouble before, but now I get the white page, like you UncleCheese.
The error is :
[Warning] mb_ereg_replace() [function.mb-ereg-replace]: mbregex compile err: unmatched close parenthesis Line 494 in /var/www/vhosts/renaudmerle.fr/httpdocs/sapphire/core/SSViewer.php
I don't see how to fix that, for now.
This issue is really weird. One out of ten requests, on average, the server act as if it was configured with
mbstring.func_overload = 7
And thus, replacing regular str functions with mb_str function, which are not really compatible.
I'm currently asking my host to completely deactivate Mbstring.
Great. Thanks for the updates. What exactly does the value of mbstring_func_overload mean, anyway? It might explain why my site is so intermittent with the problem, as well.
It happens there is one error in the pattern of two regex in sapphire/core/SSViewer.php.
Ereg_replace doesn't complain about it, but mb_ereg_replace (and preg_replace too) does. At lines 494 and 496, the last closed parenthesis of the pattern needs to be escaped
,\<\?= +([^\?]*) +\?\>) +%' . '>',
,\<\?= +([^\?]*) +\?\>\) +%' . '>',
I join a diff file.
It seems I solved the 2 visible symptoms, but I still have no clue why mbstring randomly overload str functions :/
I'm going to post two bugs report about this ereg error and about the substr_count modification in order to make it compatible with mb_substr_count.