From:             phpbugreport at webfroot dot co dot nz
Operating system: Windows XP
PHP version:      4.3.0
PHP Bug Type:     Regexps related
Bug description:  ereg_replace moving ! to start of string

Running Apache 1.3 as a service on Windows XP

$text = ereg_replace ("<a[^>]+href *= *([^ ]+)[^>]*>", "<a href=\\1>",
$text);

The above line of code is supposed to find all a tags and strip any
attributes except href.  However:

$text = "bacon <a href='http://www.whatever.com'
title='hello!'>hello</a>";

will be set to:
bacon !<a href='http://www.whatever.com' title='hello'>hello</a>

How in the hell did that exclaim get to the start of the a tag?  Maybe I'm
just doing something wrong, but it looks like a bug to me.
-- 
Edit bug report at http://bugs.php.net/?id=22371&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22371&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22371&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22371&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22371&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22371&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22371&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22371&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22371&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22371&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22371&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22371&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22371&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22371&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22371&r=gnused

Reply via email to