Re: DOMElement->setAttribute() loops forever (node_list_unlink bug?)

From: Date: Tue, 16 May 2006 07:36:38 +0000
Subject: Re: DOMElement->setAttribute() loops forever (node_list_unlink bug?)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-236266@lists.php.net to get a copy of this message
Rob Richards wrote: > Riku Palomäki wrote: >> Hello, >> >> I'm having problems with DOMElement->setAttribute() -method with my php >> script. I stripped down the code to this: >> >> ---------------------- >> $doc = new DOMDocument(); >> $doc->resolveExternals = true; >> $doc->loadXml('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 >> Strict//EN" >> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><a >> b="" />'); >> >> $root = $doc->getElementsByTagName('a')->item(0); >> $root->setAttribute('b', '&gt;'); >> $root->setAttribute('b', ''); >> >> // This will never be executed >> echo "done\n"; >> ---------------------- > > Can you please bug this (no need for the backtrace), so I don't forget > it. I see the problem but will take me a day or two to get around to fix. > > As a work around for now you can do: > $root->setAttributeNode(new DOMAttr('b', '&gt;')); > $root->setAttribute('b', ''); Ok, http://bugs.php.net/37456 -- Riku

« previous php.general (#236266) next »