From:             rob at gravityswitch dot com
Operating system: FreeBSD 6.2-RELEASE-p1 
PHP version:      5.2.3
PHP Bug Type:     PCRE related
Bug description:  Pattern causing crash

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 bug report at http://bugs.php.net/?id=41823&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41823&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41823&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41823&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41823&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41823&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41823&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41823&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41823&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41823&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41823&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41823&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41823&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41823&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41823&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41823&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41823&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41823&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41823&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41823&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41823&r=mysqlcfg

Reply via email to