|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-12 10:12 UTC] tony2001@php.net
[2007-11-13 06:42 UTC] chregu@php.net
[2007-11-14 16:00 UTC] rrichards@php.net
[2007-11-14 16:18 UTC] php at benjaminschulz dot com
[2007-11-14 16:56 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ I need to restrict the direct setting of DOM* properties to ensure that no non-utf8 encoding is getting into the Document because libxml2 (ext/dom?) still can't handle that. Implementing this i discovered that classes derived from DOM* cannot restrict the access level of properties. I think there should at least be an error raised telling that it is not allowed to change the access level of properties, but because of libxml's great segfaulting abilities i would prefer to able to restrict the access (without a magic setter). Another solution for the encoding problem might be to just check _all_ incoming strings into the DomDocument for unicode if the documents encoding is UTF-8. Reproduce code: --------------- <?php class Test extends DomDocument { protected $textContent; } $test = new Test; $test->loadXml('<foo>bar</foo>'); var_dump($test->textContent); Expected result: ---------------- Fatal Error: Cannot access protected property Text::$textContent Actual result: -------------- string(3) "bar"