ID: 37239
User updated by: dimox at inbox dot lv
Reported By: dimox at inbox dot lv
Status: Open
Bug Type: Reproducible crash
Operating System: Windows XP Pro SP2
PHP Version: 4.4.2
New Comment:
While i symlificate the code i forgot to remove \%\> from example and
posted text for parsig was too small to cause error. I found, that
block content must be more tan 1330-1360 simbols to couse script crash
- until this values it works fine! I increased all "memory size" values
in php.ini and in the code, but problem still exist.
Changed code:
$text = '<block name="name1">
something
<block name="name2">1223567890 qwertyuiop[[[]asdfghjkl;
\zxcvbnm,./zxcvbnmm, xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1223567890 qwertyuiop[[[]asdfghjkl; \zxcvbnm,./zxcvbnmm,
xsxasxaxaxae dsvvzs vsv bdbdb<> <>><<<
1234567890123456789012345678901234567890123456789012345678901
<blockend>
<blockend>';
$regex
='/\<block\s*name=\"([^\"]+)\"\s*\>((.(?!\<block\s))+?)\<blockend\>/is';
while(preg_match_all($regex, $text, $block_matches,PREG_SET_ORDER)){
...
$text = preg_replace($regex, '', $text);
}
Previous Comments:
------------------------------------------------------------------------
[2006-04-28 18:41:53] dimox at inbox dot lv
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 this bug report at http://bugs.php.net/?id=37239&edit=1