HTML_Common: _removeAttr

From: Date: Mon, 16 Aug 2004 12:04:00 +0000
Subject: HTML_Common: _removeAttr
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32706@lists.php.net to get a copy of this message
Hi list, To have XHTML compliant Output, i pass null as the first (name attribute) parameter to QF, and call removeAttribute('name'), this should remove the name attribute from the attributes array since version 3.2.3. the problem was, that the name attribute was still there after that. i saw, that the HTML_Common::_removeAttr() checks with isset() if the given attribute-name is there or not. since i passed null to QF as the form-name, isset() returns false, and the method do not remove the attribute. Of course, I can pass a string to QF as form-name, and then remove the attribute, but I think it would be better, if HTML_Common::_removeAttr() checks using array_key_exists() since $attributes is an assoc array: function _removeAttr($attr, &$attributes) {
    $attr = strtolower($attr);
    if (array_key_exists($attr,$attributes) {
        unset($attributes[$attr]);
    }
} Regards Beni ____________________________________________________________ This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning by Messagelabs, but does not guarantee the virus free transmission of this message.

« previous php.pear.dev (#32706) next »