Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46984 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38780 invoked from network); 13 Feb 2010 08:29:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2010 08:29:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=ewgraf@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ewgraf@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.219 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ewgraf@gmail.com X-Host-Fingerprint: 209.85.219.219 mail-ew0-f219.google.com Received: from [209.85.219.219] ([209.85.219.219:52515] helo=mail-ew0-f219.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/73-03148-DE2667B4 for ; Sat, 13 Feb 2010 03:29:33 -0500 Received: by ewy19 with SMTP id 19so1327339ewy.1 for ; Sat, 13 Feb 2010 00:29:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=HJUqvQl+eqNOBu5Sno2T19ESL2LTHjiSPFMjRgH3OZY=; b=e7NSyOSbMzJjL2sSHekGE9cCzIlsbmwy5K9bkEZ5sTiZVKVuQ4msonGuL3QLDyo6rM StGM9nqX59WbsXB/C+KcTWfZ1KpHG1ce8KbI7/VjqI6MHW8ZVJJB21SXTLKgToZTfZwP I9IIK/yCKzArFyB60Wb36AYWDpdfAekbc7RAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JuLoWFOJayh9DOenzmCHCl/2v0E8xPnrhi937qyvORX5h6kjQwn8jMM88ZqbElL6Tb I5xeIUIrJKuy1lNADCi60OUX6xdB6IjcLHWGdJMYPpv2f3SUJiE3oZr7djlS6hXnDOCd E5hija95IJX0pjYNIH6T7+FFutzDMv78Fq5JE= MIME-Version: 1.0 Received: by 10.216.89.9 with SMTP id b9mr1515664wef.61.1266049769685; Sat, 13 Feb 2010 00:29:29 -0800 (PST) Date: Sat, 13 Feb 2010 13:29:29 +0500 Message-ID: To: rrichards@php.net, internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: help with php bug #47532 From: ewgraf@gmail.com (Sokolov Evgeniy) Hi, I wont fix this bug: http://bugs.php.net/bug.php?id=47532, but have some questions. Can you help me? There is the test case: http://pastebin.org/91030 First, I careful that when we fix this bug, we have broken BC, because now when we write $attr->value = "foo&bar"; - value has been escaped and in var_dump($attr->value) we got "foo&bar". For fix this bug we must remove escaping. This is right? Second, for remove escaping I think we need use this patch: Index: attr.c =================================================================== --- attr.c (revision 294790) +++ attr.c (working copy) @@ -193,7 +193,7 @@ convert_to_string(newval); } - xmlNodeSetContentLen((xmlNodePtr) attrp, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); + xmlNodeAddContentLen((xmlNodePtr) attrp, Z_STRVAL_P(newval), Z_STRVAL_P(newval) + 1); if (newval == &value_copy) { zval_dtor(newval); This patch fix this cases: $attr = new DOMAttr('test', 'foo&bar'); var_dump($attr->value); $attr->value = "foo&bar"; var_dump($attr->value); but in this case we got empty value: $doc = new DOMDocument; $attr = $doc->createAttribute("foo"); $attr->value = "foo&bar"; var_dump($attr->value); Can you explain why? in first two cases wiil be call xmlNewProp libxml2 function, in last case - xmlNewDocProp. Both this functions return same variable type. -- -- Best regards