[TYPO3-core] RFC #6415: Bug: preg_replace error on php5.2 sometimes resulting in empty pages.
Olivier Schopfer
ops at wcc-coe.org
Tue Oct 28 09:07:58 CET 2008
This is a clean patch. I'd give it a +1.
Olivier Schopfer
www.oikoumene.org
Francois Suter wrote:
> Hi all,
>
>> Solution:
>> 1: Change the regular expression to a non-faulty one
>> 2: Introduce some error checking. Since php 5.2 a call to preg_last_error
>> will give some insight into the result of the last call to preg_
>> functions.
>> The patch here checks if there was an error, and if yes, then return the
>> unsubstitued content (in order to avoid empty pages) and write an
>> entry to
>> the syslog.
>> Notes:
>> The patch requires php 5.2 to run.
>
> I have tested and reviewed this patch and am +1 to it.
>
> I have taken into accounts the following of Masi's suggestions:
>
> 1) test if function preg_last_error() exists
>
> 2) make the brackets around a|area non-capturing, although this didn't
> help with the backtrack limit.
>
> Masi suggested another regex, but it was untested from his side. The
> current patch work, so improving the current could/should be another
> patch IMO.
>
> On top of that, I removed the change to the @return statement, which was
> wrong. The method still returns void.
>
> Attached is the revised patch. Obviously the target versions are now 4.2
> and trunk.
>
> Cheers
>
More information about the TYPO3-team-core
mailing list