#37239 [NEW]: Regxp couses PHP script crach on Windows
| From: | dimox at inbox dot lv | Date: | Fri, 28 Apr 2006 18:41:53 +0000 |
| Subject: | #37239 [NEW]: Regxp couses PHP script crach on Windows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-96330@lists.php.net to get a copy of this message | ||
From: dimox at inbox dot lv
Operating system: Windows XP Pro SP2
PHP version: 4.4.2
PHP Bug Type: Reproducible crash
Bug description: Regxp couses PHP script crach on Windows
Description:
------------
Regxp couses PHP script crach on Windows. On Linux Server it works fine,
but I use Windows server on my PC for development.
I try this code on my own PC with Apache/1.3.34 (Win32) PHP/4.4.2 and on
another PC with Apache/1.3.34 (Win32) PHP/4.4.1. On my PC this code souses
Apache crash, but on another PC this code couses only script crash. I
looking information about this bug anywere, but can't find anything
useful, except http://bugs.php.net/bug.php?id=27735. I try with
logs
disconnection, but it doesn't change anything.
Help ...
Reproduce code:
---------------
$regex =
'/block\s*name=\"([^\"]+)\"\s*\%\>((.(?!(block\s)))+?)\blockend/is';
while(preg_match_all($regex, $text, $block_matches, PREG_SET_ORDER)){
...
}
Expected result:
----------------
$block_matches array with results of regular expression matches. I need in
this to parse blocks like
block name="name1"
something
block name="name2"
something else
...
blockend
blockend
Actual result:
--------------
"Server not found" or "The page cannot be displayed" in browser.
After simplification of code to:
$regex = '/block\s*name=\"([^\"]+)\"\s*\%\>(.+?)\blockend/is';
while(preg_match_all($regex, $text, $block_matches, PREG_SET_ORDER)){
...
}
all works fine(remooved lookahead assertion). If i add () around the '.' -
script crash again.
$regex = '/block\s*name=\"([^\"]+)\"\s*\%\>((.)+?)\blockend/is';
--
Edit bug report at http://bugs.php.net/?id=37239&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37239&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37239&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37239&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37239&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37239&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37239&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37239&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37239&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37239&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37239&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37239&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37239&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37239&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37239&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37239&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37239&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37239&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37239&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37239&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37239&r=mysqlcfg