6.0.0-beta1
8/9/25

[#4710] DOM handler may elicit notices on undefined variable tagName
Summary DOM handler may elicit notices on undefined variable tagName
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester wrobel (at) gentoo (dot) org
Created 11/29/2006 (6828 days ago)
Due
Updated 11/30/2006 (6827 days ago)
Assigned
Resolved 11/30/2006 (6827 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/30/2006 08:02:39 AM wrobel (at) gentoo (dot) org Comment #4 Reply to this comment
Thanks for the comment. Reconsidered it and you are right. :)
11/30/2006 12:35:20 AM Chuck Hagenbuch Comment #3
State ⇒ Not A Bug
Reply to this comment
I don't think this is a bug, really - we could go all out with 
defensive programming with the DOM layer, but that's really not what 
it's for. If you accessed tagname directly on the wrong kind of node 
in PHP 4 or PHP 5 native code, you'd get the same error.
11/30/2006 12:23:00 AM Chuck Hagenbuch Deleted Original Message
 
11/29/2006 08:41:40 AM wrobel (at) gentoo (dot) org Comment #2
New Attachment: framework_DOM_DOM.php-tagname_fix-20061129.patch Download
Reply to this comment
Sorry, attached the class instead of the patch. Need coffee. Please 
delete the other attachment.
11/29/2006 08:40:32 AM wrobel (at) gentoo (dot) org Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ DOM handler may elicit notices on undefined variable tagName
Queue ⇒ Horde Framework Packages
New Attachment: DOM.php
State ⇒ Unconfirmed
Reply to this comment
The property "tagName" is only defined for DOM objects of type DOMElement.



The call __get('tagname') on Horde_DOM_Node results in notices if the 
node is something else than a DOMElement.



I'm not certain if the code should return an empty value or an error 
in order to force the upstream class to check if it is an Element or 
another node type.



I checked the original script but it seems to accept that there might 
be notices:



http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/domxml-php4-to-php5.php.txt

Saved Queries