[TYPO3-core] RFC: Bug #13972: cropHTML uses faulty reg exp for HTML entities

Jochen Rau jochen.rau at typoplanet.de
Thu Apr 15 15:04:33 CEST 2010


Hi.

On 15.04.10 14:40, Marcus Krause wrote:
> Ralf Hettinger schrieb am 04/15/2010 01:55 PM Uhr:
>> This is an SVN patch request.
>>
>> Type:
>> Bugfix
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=13972
>>
>> Branches:
>> 4.3 (patch applies with offset)&  trunk
>>
>> Problem:
>> The feature stdWrap.cropHTML uses a faulty regular expression / search
>> pattern for treating encoded HTML entities as a single character, which
>> is supposed to avoid cropping in between such entities and counting them
>> as one character. The search pattern as used in the current preg_match
>> currently always crops after the first semicolon and won't recognize
>> such entites reliably.
>
> Could you please add an unit test first which demonstrates that the
> regex is broken and therefore fails? cropHTML is covered by unit tests
> and all current ones pass. We should stick to this.
>
> desired order:
> 1. commit a unit test which fails
> 2. commit the patch that fixes the faulty behaviour

I can confirm this as a bug. I have altered the unit tests to show up 
the fault. The patch provided by Ralf resolves the issue. The attached 
patch contains his patch and my unit tests.

+1 by reading and testing

Thanks Ralf.

Regards
Jochen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: issue_13972_v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100415/108198cc/attachment.asc>


More information about the TYPO3-team-core mailing list