#43107 [Asn]: access level of DOM* properties are not applied

From: Date: Tue, 13 Nov 2007 06:42:57 +0000
Subject: #43107 [Asn]: access level of DOM* properties are not applied
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119580@lists.php.net to get a copy of this message
ID: 43107 Updated by: chregu@php.net Reported By: php at benjaminschulz dot com Status: Assigned Bug Type: DOM XML related PHP Version: 5.3CVS-2007-10-26 (CVS) -Assigned To: chregu +Assigned To: rrichards New Comment: Rob, can you look into that? I have no idea about that part of code, not even if it's possible :) Previous Comments: ------------------------------------------------------------------------ [2007-11-12 10:12:08] tony2001@php.net Assigned to the maintainer. ------------------------------------------------------------------------ [2007-10-26 07:02:09] php at benjaminschulz dot com 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" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43107&edit=1

« previous php.bugs (#119580) next »