FS#38323 - [php] incompatibilities with pcre 8.34

Attached to Project: Arch Linux
Opened by Bruno Mathieu (bmathieu) - Monday, 30 December 2013, 15:20 GMT
Last edited by Pierre Schmitz (Pierre) - Thursday, 01 May 2014, 06:56 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

With pcre-8.34, the php preg_replace function makes some CMS buggy.

Additional info:
* package version(s)
php 5.5.7-1 pcre 8.34-1

* config and/or log files etc.
Standard php and pcre packages on x86_64

Steps to reproduce:
<?php
echo preg_replace('/[^._=-\w\d]+/', "_","un-essai!");
?>
With pcre 8.33, the regex compiles, and the script returns "un-essai_".
With pcre 8.34, the function return nothing (empty string ?) and PHP warns me :
PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 7 in - on line 2


This task depends upon

Closed by  Pierre Schmitz (Pierre)
Thursday, 01 May 2014, 06:56 GMT
Reason for closing:  Upstream
Comment by Gergely (imrehg) - Wednesday, 01 January 2014, 14:13 GMT
Duplicate of  FS#38317 ?
Comment by Bruno Mathieu (bmathieu) - Wednesday, 01 January 2014, 18:53 GMT
It's not the same error. But yes, that's related.

My problem wasn't with MediaWiki but whith SPIP :
http://core.spip.org/issues/3132#change-9181

I've explained my problem on the prce bug tracker here :
http://bugs.exim.org/show_bug.cgi?id=1429

In short :

A php application without a warning with libpcre 8.33 hangs now with this new release.
It would have been nicer and easier to track bugs if php had complained about such broken expression with pcre 8.33.
Maybe something like a php version which detects broken expressions and behaves like with pcre 8.33, but with a warning in the logs.

Comment by Pierre Schmitz (Pierre) - Thursday, 01 May 2014, 06:56 GMT
Nothing for us to do here. The regex is indeed invalid and needs to be fixed. It is unfortunate though that it was accepted in previous releases. But there is nothing a distribution can fix about this.

Loading...