#31191 [NEW]: "unterminated entity reference" when using the value parameter to createElement

From: Date: Mon, 20 Dec 2004 05:46:16 +0000
Subject: #31191 [NEW]: "unterminated entity reference" when using the value parameter to createElement
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70663@lists.php.net to get a copy of this message
From: php at owenpshaw dot net Operating system: Linux PHP version: 5.0.3 PHP Bug Type: DOM XML related Bug description: "unterminated entity reference" when using the value parameter to createElement Description: ------------ It looks like no escaping is done to the optional "value" parameter in the DomDocument::createElement() and DomDocument::createElementNS(). The online documentation doesn't specify what the correct behavior should be, and it's not part of the DOM standard, so it seems possible that this is a bug. Reproduce code: --------------- $document = new DomDocument(); $element = $document->createElement('foo','&'); Expected result: ---------------- I would expect the '&' (or any other character that should be escaped) to be escaped as if I had used DomDocument::createTextNode(). Actual result: -------------- Warning: unterminated entity reference in [FILE] on line [LINE] -- Edit bug report at http://bugs.php.net/?id=31191&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31191&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31191&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31191&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31191&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31191&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31191&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31191&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31191&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31191&r=support Expected behavior: http://bugs.php.net/fix.php?id=31191&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31191&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31191&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31191&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31191&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31191&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31191&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31191&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31191&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31191&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31191&r=mysqlcfg

« previous php.bugs (#70663) next »