From kde-commits Mon Jan 31 13:49:57 2005 From: David Faure Date: Mon, 31 Jan 2005 13:49:57 +0000 To: kde-commits Subject: kdelibs/khtml/html Message-Id: <20050131134957.971C619D99 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=110717944420956 CVS commit by faure: setInnerHTML fix: check whether the contents will be allowed before deleting all children BUG: 96187 M +6 -1 html_elementimpl.cpp 1.184 --- kdelibs/khtml/html/html_elementimpl.cpp #1.183:1.184 @@ -554,6 +554,11 @@ bool HTMLElementImpl::setInnerHTML( cons return false; - removeChildren(); int ec = 0; + // Make sure adding the new child is ok, before removing all children (#96187) + checkAddChild( fragment.handle(), ec); + if ( ec ) + return false; + + removeChildren(); appendChild( fragment.handle(), ec ); return !ec;