From: wilco at pangeadc dot nl Operating system: windows PHP version: 5.1.4 PHP Bug Type: DOM XML related Bug description: PHP doesn't see the ID of input elements
Description: ------------ It seems to me PHP is unable to find the ID of input elements using the loadHTML function. I've tried many combinations and I can locate any element with this script accept the input. The problem also occures on domdoccument::getElementById. Reproduce code: --------------- <?PHP $htmlcode = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html><head><title>Foo my bar</title></head> <body><input id=\"my_input\" /><textarea cols=\"3\" rows=\"2\" id=\"my_textarea\" /></body> </html>"; $html = new DOMDocument(); $html->loadHTML($htmlcode); $html->validate(); $input = $html->getElementsByTagName('input')->item(0); echo "input: "; var_dump($input->getAttributeNode('id')->isId()); $textarea = $html->getElementsByTagName('textarea')->item(0); echo "textarea: "; var_dump($textarea->getAttributeNode('id')->isId()); ?> Expected result: ---------------- input: bool(true) textarea: bool(true) Actual result: -------------- input: bool(false) textarea: bool(true) -- Edit bug report at http://bugs.php.net/?id=37801&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37801&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37801&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37801&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37801&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37801&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37801&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37801&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37801&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37801&r=support Expected behavior: http://bugs.php.net/fix.php?id=37801&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37801&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37801&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37801&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37801&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37801&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37801&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37801&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37801&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37801&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37801&r=mysqlcfg