#41823 [Opn->Fbk]: Pattern causing crash
| From: | scottmac@php.net | Date: | Wed, 27 Jun 2007 13:58:17 +0000 |
| Subject: | #41823 [Opn->Fbk]: Pattern causing crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114337@lists.php.net to get a copy of this message | ||
ID: 41823
Updated by: scottmac@php.net
Reported By: rob at gravityswitch dot com
-Status: Open
+Status: Feedback
Bug Type: PCRE related
Operating System: FreeBSD 6.2-RELEASE-p1
PHP Version: 5.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2007-06-27 13:55:48] rob at gravityswitch dot com
Description:
------------
This problem showed up after an upgrade to php 5.2.3 that was
accompanied by a pcre upgrade to ver 7.0. It works fine on my local
system (php 5.2.3, pcre 6.7)
The browser returns a download dialog rather than an error.
If I remove the "=" from the pattern, it works, but doesn't find
anything.
Reproduce code:
---------------
<?php
$s =
"((?is-U)<input(?:(?:\s*\w*\s*(?:=(?:(?:'.*?')|(?:\".*?\")|(?:\w*)))?)*)(?:>|(?:\/>)))";
$formHTML = "Nothing to see here:<input name='blah'
value=''></input>";
echo preg_replace("/" . $s . "/is", "muffin", $formHTML);
?>
Expected result:
----------------
I would expect this code to replace the input tag string with "muffin".
I would also expect it not to crash.
Actual result:
--------------
Download dialog box.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41823&edit=1