From:             doktor at farlep dot net
Operating system: Linux Slackware  9.1.0
PHP version:      4.4.4
PHP Bug Type:     *Regular Expressions
Bug description:  preg_replace in UTF-mode memory leak

Description:
------------
usage unicode character properties \pL and \Sm in function preg_replace
give apache memory leak. (apache compilled with libphp4.a)
linux load average up to 98 

Reproduce code:
---------------
$patterns[] =
"#\[url=([\pL]+?://[(\pL\Sm\#$%&~/.\-;:=,[EMAIL 
PROTECTED])\]([^?\n\r\t].*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url3'];
$text = preg_replace($patterns, $replacements, $text);

Expected result:
----------------
replacing unicode characters in bbcode ( work fine with \w property, but
in utf mode with values greater than 128 never match)

Actual result:
--------------
memory leak
load average: 98.3
fixed - not usage \pL and \Sm in preg_replace and restarting apache
server


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

Reply via email to