[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2008-10-20 Thread Rob Richards
rrichards   Mon Oct 20 19:29:40 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #46323 (compilation of simplexml for NetWare breaks)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.44r2=1.151.2.22.2.45diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.44 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.45
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.44   Thu Sep 11 14:23:33 2008
+++ php-src/ext/simplexml/simplexml.c   Mon Oct 20 19:29:40 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.44 2008/09/11 14:23:33 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.45 2008/10/20 19:29:40 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1233,7 +1233,7 @@
if (nodeptr-type == XML_TEXT_NODE) {
_node_as_zval(sxe, nodeptr-parent, value, 
SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
} else if (nodeptr-type == XML_ATTRIBUTE_NODE) {
-   _node_as_zval(sxe, nodeptr-parent, value, 
SXE_ITER_ATTRLIST, (char*)nodeptr-name, nodeptr-ns ? nodeptr-ns-href : 
NULL, 0 TSRMLS_CC);
+   _node_as_zval(sxe, nodeptr-parent, value, 
SXE_ITER_ATTRLIST, (char*)nodeptr-name, nodeptr-ns ? (xmlChar 
*)nodeptr-ns-href : NULL, 0 TSRMLS_CC);
} else {
_node_as_zval(sxe, nodeptr, value, 
SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
}
@@ -2450,7 +2450,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.44 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.45 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug46047.phpt

2008-09-11 Thread Rob Richards
rrichards   Thu Sep 11 14:23:33 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug46047.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #46047 (SimpleXML converts empty nodes into object with nested 
array)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.43r2=1.151.2.22.2.44diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.43 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.44
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.43   Wed Sep 10 16:29:17 2008
+++ php-src/ext/simplexml/simplexml.c   Thu Sep 11 14:23:33 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.43 2008/09/10 16:29:17 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.44 2008/09/11 14:23:33 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1101,9 +1101,13 @@
SKIP_TEXT(node);
} else {
if (node-type == XML_TEXT_NODE) {
-   MAKE_STD_ZVAL(value);
-   ZVAL_STRING(value, 
sxe_xmlNodeListGetString(node-doc, node, 1), 0);
-   zend_hash_next_index_insert(rv, value, 
sizeof(zval *), NULL);
+   const xmlChar *cur = node-content;
+   
+   if (*cur != 0) {
+   MAKE_STD_ZVAL(value);
+   ZVAL_STRING(value, 
sxe_xmlNodeListGetString(node-doc, node, 1), 0);
+   zend_hash_next_index_insert(rv, 
value, sizeof(zval *), NULL);
+   }
goto next_iter;
}
}
@@ -2446,7 +2450,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.43 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.44 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug46047.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug46047.phpt
+++ php-src/ext/simplexml/tests/bug46047.phpt
--TEST--
Bug #46047 (SimpleXML converts empty nodes into object with nested array)
--FILE--
?php
$xml = new SimpleXMLElement('foobar![CDATA[]]/barbaz//foo', 
  LIBXML_NOCDATA);
print_r($xml);

$xml = new SimpleXMLElement('foobar/barbaz//foo');
print_r($xml);

$xml = new SimpleXMLElement('foobar/baz//foo');
print_r($xml);
?
--EXPECTF--
SimpleXMLElement Object
(
[bar] = SimpleXMLElement Object
(
)

[baz] = SimpleXMLElement Object
(
)

)
SimpleXMLElement Object
(
[bar] = SimpleXMLElement Object
(
)

[baz] = SimpleXMLElement Object
(
)

)
SimpleXMLElement Object
(
[bar] = SimpleXMLElement Object
(
)

[baz] = SimpleXMLElement Object
(
)

)


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug45553.phpt

2008-09-10 Thread Rob Richards
rrichards   Wed Sep 10 11:21:49 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug45553.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #45553 (Using XPath for attributes with a namespace does not 
work)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.41r2=1.151.2.22.2.42diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.41 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.42
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.41   Fri May 23 15:46:54 2008
+++ php-src/ext/simplexml/simplexml.c   Wed Sep 10 11:21:48 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.41 2008/05/23 15:46:54 iliaa Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.42 2008/09/10 11:21:48 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1229,7 +1229,7 @@
if (nodeptr-type == XML_TEXT_NODE) {
_node_as_zval(sxe, nodeptr-parent, value, 
SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
} else if (nodeptr-type == XML_ATTRIBUTE_NODE) {
-   _node_as_zval(sxe, nodeptr-parent, value, 
SXE_ITER_ATTRLIST, (char*)nodeptr-name, NULL, 0 TSRMLS_CC);
+   _node_as_zval(sxe, nodeptr-parent, value, 
SXE_ITER_ATTRLIST, (char*)nodeptr-name, nodeptr-ns ? nodeptr-ns-href : 
NULL, 0 TSRMLS_CC);
} else {
_node_as_zval(sxe, nodeptr, value, 
SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
}
@@ -2446,7 +2446,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.41 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.42 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug45553.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug45553.phpt
+++ php-src/ext/simplexml/tests/bug45553.phpt
--TEST--
Bug #45553 (Using XPath to return values for attributes with a namespace does 
not work)
--FILE--
?php
$xml =XML
xml xmlns:a=http://a;
data a:label=I am A label=I am Nothingtest1/data
a:data a:label=I am a:A label=I am a:Nothingtest2/a:data
/xml
XML;

$x = simplexml_load_string($xml);
$x-registerXPathNamespace(a, http://a;);

$atts = $x-xpath(/xml/data/@a:label);
echo $atts[0] . \n;
$atts = $x-xpath(/xml/a:data);
echo $atts[0]-attributes() . \n;
$atts = $x-xpath(/xml/a:data/@a:label);
echo $atts[0] . \n;
$atts = $x-xpath(/xml/a:data/@label);
echo $atts[0] . \n;
$atts = $x-xpath(/xml/data/@label);
echo $atts[0] . \n;
?
--EXPECTF--
I am A
I am a:Nothing
I am a:A
I am a:Nothing
I am Nothing


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug46003.phpt

2008-09-10 Thread Rob Richards
rrichards   Wed Sep 10 16:29:18 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug46003.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #46003 (isset on nonexisting node return unexpected results)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.42r2=1.151.2.22.2.43diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.42 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.43
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.42   Wed Sep 10 11:21:48 2008
+++ php-src/ext/simplexml/simplexml.c   Wed Sep 10 16:29:17 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.42 2008/09/10 11:21:48 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.43 2008/09/10 16:29:17 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -800,7 +800,7 @@
while (node) {
xmlNodePtr nnext;
nnext = node-next;
-   if (!xmlStrcmp(node-name, (xmlChar 
*)Z_STRVAL_P(member))) {
+   if ((node-type == XML_ELEMENT_NODE)  
!xmlStrcmp(node-name, (xmlChar *)Z_STRVAL_P(member))) {
break;
}
node = nnext;
@@ -2446,7 +2446,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.42 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.43 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug46003.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug46003.phpt
+++ php-src/ext/simplexml/tests/bug46003.phpt
--TEST--
Bug #46003 (isset on nonexisting nodes return unexpected results)
--FILE--
?php
$xml =XML
r
  pTest/p
  o d='h'
xx rr='info' /
yy rr='data' /
  /o
/r
XML;

$x = simplexml_load_string($xml);

var_dump(isset($x-p));
var_dump(isset($x-p-o));
var_dump(isset($x-o-yy));
var_dump(isset($x-o-zz));
var_dump(isset($x-o-text));
var_dump(isset($x-o-xx));
?
--EXPECTF--
bool(true)
bool(false)
bool(true)
bool(false)
bool(false)
bool(true)


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug44478.phpt

2008-03-20 Thread Rob Richards
rrichards   Thu Mar 20 16:48:45 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug44478.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #44478 (Inconsistent behaviour when assigning new nodes)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.38r2=1.151.2.22.2.39diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.38 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.39
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.38   Thu Jan 31 21:59:41 2008
+++ php-src/ext/simplexml/simplexml.c   Thu Mar 20 16:48:45 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.38 2008/01/31 21:59:41 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.39 2008/03/20 16:48:45 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -422,19 +422,12 @@
convert_to_string(value);
/* break missing intentionally */
case IS_STRING:
-   if (node-type == XML_ATTRIBUTE_NODE) {
-   buffer = xmlEncodeEntitiesReentrant(node-doc, 
(xmlChar *)Z_STRVAL_P(value));
-   buffer_len = xmlStrlen(buffer);
-   } else {
-   buffer = (xmlChar *)Z_STRVAL_P(value);
-   buffer_len = Z_STRLEN_P(value);
-   }
+   buffer = xmlEncodeEntitiesReentrant(node-doc, (xmlChar 
*)Z_STRVAL_P(value));
+   buffer_len = xmlStrlen(buffer);
/* check for NULL buffer in case of memory error in 
xmlEncodeEntitiesReentrant */
if (buffer) {
xmlNodeSetContentLen(node, buffer, buffer_len);
-   if (node-type == XML_ATTRIBUTE_NODE) {
-   xmlFree(buffer);
-   }
+   xmlFree(buffer);
}
if (value == value_copy) {
zval_dtor(value);
@@ -2452,7 +2445,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.38 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.39 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug44478.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug44478.phpt
+++ php-src/ext/simplexml/tests/bug44478.phpt
--TEST--
Bug #44478 (Inconsistent behaviour when assigning new nodes)
--FILE--
?php
$xml_element = new simpleXMLElement('root/root');
$xml_element-node1 = 'a #38; b';
print $xml_element-node1.\n;
$xml_element-node1 = 'a #38; b';
print $xml_element-node1.\n;
$xml_element-addChild('node2','a #38; b');
print $xml_element-node2.\n;
$xml_element-node2 = 'a  b';
print $xml_element-node2.\n;

print $xml_element-asXML();

?
--EXPECTF--
a #38; b
a #38; b
a  b
a  b
?xml version=1.0?
rootnode1a amp;#38; b/node1node2a amp; b/node2/root



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug42369.phpt

2008-01-31 Thread Rob Richards
rrichards   Thu Jan 31 21:59:42 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug42369.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #42369 (Implicit conversion to string leaks memory)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.37r2=1.151.2.22.2.38diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.37 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.38
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.37   Mon Dec 31 07:20:11 2007
+++ php-src/ext/simplexml/simplexml.c   Thu Jan 31 21:59:41 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.37 2007/12/31 07:20:11 sebastian Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.38 2008/01/31 21:59:41 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1740,6 +1740,11 @@
}
}
 
+   if (readobj == writeobj) {
+   INIT_PZVAL(writeobj);
+   zval_dtor(readobj);
+   }
+
rv = cast_object(writeobj, type, (char *)contents TSRMLS_CC);
 
if (contents) {
@@ -2447,7 +2452,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.37 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.38 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug42369.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug42369.phpt
+++ php-src/ext/simplexml/tests/bug42369.phpt
--TEST--
Bug #42369 (Implicit conversion to string leaks memory)
--SKIPIF--
?php if (!extension_loaded('simplexml')) echo 'skip simplexml extension is not 
loaded'; 
--FILE--
?php
$xml = '?xml version=1.0 encoding=utf-8?';
$x = simplexml_load_string($xml . qxfoo/x/q);

echo 'explicit conversion' . PHP_EOL;
for ($i = 0; $i  10; $i++) {
md5(strval($x-x));
}

echo 'no conversion' . PHP_EOL;
for ($i = 0; $i  10; $i++) {
md5($x-x);
}

echo 'done' . PHP_EOL;
?
--EXPECT--
explicit conversion
no conversion
done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug43221.phpt

2007-11-12 Thread Rob Richards
rrichards   Mon Nov 12 18:59:26 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug43221.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #43221 (SimpleXML adding default namespace in addAttribute)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35r2=1.151.2.22.2.36diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.36
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35   Tue Jul 31 15:40:49 2007
+++ php-src/ext/simplexml/simplexml.c   Mon Nov 12 18:59:26 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.35 2007/07/31 15:40:49 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.36 2007/11/12 18:59:26 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1635,6 +1635,13 @@
 
localname = xmlSplitQName2((xmlChar *)qname, prefix);
if (localname == NULL) {
+   if (nsuri_len  0) {
+   if (prefix != NULL) {
+   xmlFree(prefix);
+   }
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Attribute 
requires prefix for namespace);
+   return;
+   }
localname = xmlStrdup((xmlChar *)qname);
}
 
@@ -2440,7 +2447,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.35 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.36 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug43221.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug43221.phpt
+++ php-src/ext/simplexml/tests/bug43221.phpt
--TEST--
Bug #43221 (SimpleXML adding default namespace in addAttribute)
--FILE--
?php
$xml = simplexml_load_string('?xml version=1.0 encoding=utf-8?root /');
$n = $xml-addChild(node, value);
$n-addAttribute(a, b);
$n-addAttribute(c, d, http://bar.com;);
$n-addAttribute(foo:e, f, http://bar.com;);
print_r($xml-asXml());
?
--EXPECTF--
Warning: SimpleXMLElement::addAttribute(): Attribute requires prefix for 
namespace in %sbug43221.php on line %d
?xml version=1.0 encoding=utf-8?
rootnode xmlns:foo=http://bar.com; a=b foo:e=fvalue/node/root

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2007-07-31 Thread Rob Richards
rrichards   Tue Jul 31 15:07:54 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix possible crash
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.33r2=1.151.2.22.2.34diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.33 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.34
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.33   Tue Jul 10 12:24:51 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jul 31 15:07:54 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.33 2007/07/10 12:24:51 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.34 2007/07/31 15:07:54 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1575,7 +1575,9 @@
newnode-ns = NULL;
nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
} else {
-   nsptr = xmlSearchNsByHref(node-doc, node, (xmlChar 
*)nsuri);
+   if (node) {
+   nsptr = xmlSearchNsByHref(node-doc, node, 
(xmlChar *)nsuri);
+   }
if (nsptr == NULL) {
nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, 
prefix);
}
@@ -2435,7 +2437,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.33 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.34 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2007-07-31 Thread Rob Richards
rrichards   Tue Jul 31 15:40:49 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix bug #41833 (addChild() on a non-existent node, no node created, 
getName() segfaults)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.34r2=1.151.2.22.2.35diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.34 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.34   Tue Jul 31 15:07:54 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jul 31 15:40:49 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.34 2007/07/31 15:07:54 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.35 2007/07/31 15:40:49 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1563,6 +1563,11 @@
 
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
 
+   if (node == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot add child. 
Parent is not a permanent member of the XML tree);
+   return; 
+   }
+
localname = xmlSplitQName2((xmlChar *)qname, prefix);
if (localname == NULL) {
localname = xmlStrdup((xmlChar *)qname);
@@ -1575,9 +1580,7 @@
newnode-ns = NULL;
nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
} else {
-   if (node) {
-   nsptr = xmlSearchNsByHref(node-doc, node, 
(xmlChar *)nsuri);
-   }
+   nsptr = xmlSearchNsByHref(node-doc, node, (xmlChar 
*)nsuri);
if (nsptr == NULL) {
nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, 
prefix);
}
@@ -2437,7 +2440,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.34 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.35 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug41947.phpt

2007-07-10 Thread Rob Richards
rrichards   Tue Jul 10 12:24:51 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug41947.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix bug #41947 (SimpleXML incorrectly registers empty strings as namespaces
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.32r2=1.151.2.22.2.33diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.32 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.33
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.32   Wed Jul  4 05:05:57 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jul 10 12:24:51 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.32 2007/07/04 05:05:57 pollita Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.33 2007/07/10 12:24:51 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1571,11 +1571,16 @@
newnode = xmlNewChild(node, NULL, localname, (xmlChar *)value);
 
if (nsuri != NULL) {
-   nsptr = xmlSearchNsByHref(node-doc, node, (xmlChar *)nsuri);
-   if (nsptr == NULL) {
+   if (nsuri_len == 0) {
+   newnode-ns = NULL;
nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
+   } else {
+   nsptr = xmlSearchNsByHref(node-doc, node, (xmlChar 
*)nsuri);
+   if (nsptr == NULL) {
+   nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, 
prefix);
+   }
+   newnode-ns = nsptr;
}
-   newnode-ns = nsptr;
}
 
_node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, (char 
*)localname, prefix, 0 TSRMLS_CC);
@@ -2430,7 +2435,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.32 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.33 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug41947.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug41947.phpt
+++ php-src/ext/simplexml/tests/bug41947.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug41861.phpt

2007-07-03 Thread Rob Richards
rrichards   Tue Jul  3 14:55:53 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug41861.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix bug #41861 (getNamespaces() returns namespaces of node's siblings)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.30r2=1.151.2.22.2.31diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.30 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.31
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.30   Mon Jul  2 11:35:18 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jul  3 14:55:53 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.30 2007/07/02 11:35:18 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.31 2007/07/03 14:55:53 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1396,15 +1396,12 @@
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
 
-   while (node) {
-   SKIP_TEXT(node)
+   if (node) {
if (node-type == XML_ELEMENT_NODE) {
sxe_add_namespaces(sxe, node, recursive, return_value 
TSRMLS_CC);
} else if (node-type == XML_ATTRIBUTE_NODE  node-ns) {
sxe_add_namespace_name(return_value, node-ns);
}
-next_iter:
-   node = node-next;
}
 }
 /* }}} */
@@ -2423,7 +2420,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.30 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.31 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug41861.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug41861.phpt
+++ php-src/ext/simplexml/tests/bug41861.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2007-06-24 Thread Nuno Lopes
nlopess Sun Jun 24 11:41:12 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix memleak in sxe_prop_dim_read()
  #found by coverity
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.28r2=1.151.2.22.2.29diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.28 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.29
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.28   Wed Jun 13 13:38:26 2007
+++ php-src/ext/simplexml/simplexml.c   Sun Jun 24 11:41:12 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.28 2007/06/13 13:38:26 dmitry Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.29 2007/06/24 11:41:12 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -271,9 +271,6 @@
name = Z_STRVAL_P(member);
}
 
-   MAKE_STD_ZVAL(return_value);
-   ZVAL_NULL(return_value);
-
GET_NODE(sxe, node);
 
if (sxe-iter.type == SXE_ITER_ATTRLIST) {
@@ -294,6 +291,9 @@
}
}
 
+   MAKE_STD_ZVAL(return_value);
+   ZVAL_NULL(return_value);
+
if (node) {
if (attribs) {
if (Z_TYPE_P(member) != IS_LONG || sxe-iter.type == 
SXE_ITER_ATTRLIST) {
@@ -2419,7 +2419,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.28 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.29 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests 027.phpt bug35785.phpt bug41582.phpt

2007-06-13 Thread Dmitry Stogov
dmitry  Wed Jun 13 13:38:26 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/simplexml/tests027.phpt bug35785.phpt bug41582.phpt 
  Log:
  Fixed wrong fix for bug #41582
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.27r2=1.151.2.22.2.28diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.27 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.28
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.27   Tue Jun  5 10:03:12 2007
+++ php-src/ext/simplexml/simplexml.c   Wed Jun 13 13:38:26 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.27 2007/06/05 10:03:12 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.28 2007/06/13 13:38:26 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -249,18 +249,16 @@
int nodendx = 0;
int test = 0;
 
-   if (!member) {
-   return_value = EG(uninitialized_zval);
-   return_value-is_ref = 1;
-   return return_value;
-   }
-
sxe = php_sxe_fetch_object(object TSRMLS_CC);
 
-   if (Z_TYPE_P(member) == IS_LONG) {
+   if (!member || Z_TYPE_P(member) == IS_LONG) {
if (sxe-iter.type != SXE_ITER_ATTRLIST) {
attribs = 0;
elements = 1;
+   } else if (!member) {
+   /* This happens when the user did: $sxe[]-foo = $value 
*/
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot 
create unnamed attribute);
+   return NULL;
}
name = NULL;
} else {
@@ -288,6 +286,12 @@
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
attr = node ? node-properties : NULL;
test = 0;
+   if (!member  node  node-parent 
+   node-parent-type == XML_DOCUMENT_NODE) {
+   /* This happens when the user did: $sxe[]-foo = $value 
*/
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot 
create unnamed attribute);
+   return NULL;
+   }
}
 
if (node) {
@@ -320,13 +324,30 @@
if (!sxe-node) {

php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL 
TSRMLS_CC);
}
-   if (Z_TYPE_P(member) == IS_LONG) {
+   if (!member || Z_TYPE_P(member) == IS_LONG) {
+   long cnt = 0;
+   xmlNodePtr mynode = node;
+
if (sxe-iter.type == SXE_ITER_CHILD) {
node = php_sxe_get_first_node(sxe, node 
TSRMLS_CC);
}
-   node = sxe_get_element_by_offset(sxe, 
Z_LVAL_P(member), node, NULL);
+   if (sxe-iter.type == SXE_ITER_NONE) {
+   if (member  Z_LVAL_P(member)  0) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Cannot add element %s number %ld when only 0 such 
elements exist, mynode-name, Z_LVAL_P(member));
+   }
+   } else if (member) {
+   node = sxe_get_element_by_offset(sxe, 
Z_LVAL_P(member), node, cnt);
+   } else {
+   node = NULL;
+   }
if (node) {
_node_as_zval(sxe, node, return_value, 
SXE_ITER_NONE, NULL, sxe-iter.nsprefix, sxe-iter.isprefix TSRMLS_CC);
+   } else if (type == BP_VAR_W || type == 
BP_VAR_RW) {
+   if (member  cnt  Z_LVAL_P(member)) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Cannot add element %s number %ld when only %ld such 
elements exist, mynode-name, Z_LVAL_P(member), cnt);
+   }
+   node = xmlNewTextChild(mynode-parent, 
mynode-ns, mynode-name, NULL);
+   _node_as_zval(sxe, node, return_value, 
SXE_ITER_NONE, NULL, sxe-iter.nsprefix, sxe-iter.isprefix TSRMLS_CC);
}
} else {
 #if SXE_ELEMENT_BY_NAME
@@ -431,7 +452,6 @@
 static void sxe_prop_dim_write(zval *object, zval *member, zval *value, 
zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode TSRMLS_DC)
 {
php_sxe_object *sxe;
-   char 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2007-04-24 Thread Ilia Alshanetsky
iliaa   Tue Apr 24 14:11:29 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  Fixed error message to reflect the check
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.25r2=1.151.2.22.2.26diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.25 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.26
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.25   Tue Apr 24 13:54:59 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Apr 24 14:11:28 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.25 2007/04/24 13:54:59 iliaa Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.26 2007/04/24 14:11:28 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1543,7 +1543,7 @@
}
 
if (qname_len == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Attribute name and 
value are required);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Attribute name is 
required);
return;
}
 
@@ -2368,7 +2368,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.25 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.26 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug37386.phpt

2007-03-26 Thread Rob Richards
rrichards   Mon Mar 26 20:14:58 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug37386.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix bug #37386 (autocreating element doesn't assign value to first node)
  all single SimpleXMLElements are addressable using offset 0
  use correct node for xpath context node
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.23r2=1.151.2.22.2.24diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.23 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.24
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.23   Tue Feb 20 14:08:43 2007
+++ php-src/ext/simplexml/simplexml.c   Mon Mar 26 20:14:58 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.23 2007/02/20 14:08:43 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.24 2007/03/26 20:14:58 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -138,7 +138,14 @@
long nodendx = 0;

if (sxe-iter.type == SXE_ITER_NONE) {
-   return NULL;
+   if (offset == 0) {
+   if (cnt) {
+   *cnt = 0;
+   }
+   return node;
+   } else {
+   return NULL;
+   }
}
while (node  nodendx = offset) {
SKIP_TEXT(node)
@@ -429,7 +436,7 @@
int nodendx = 0;
int test = 0;
int new_value = 0;
-   longcnt;
+   longcnt = 0;
zvaltmp_zv, trim_zv, value_copy;
 
if (!member) {
@@ -1122,9 +1129,11 @@
php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, 
xmlDocGetRootElement((xmlDocPtr) sxe-document-ptr), NULL TSRMLS_CC);
}
 
-   sxe-xpath-node = sxe-node-node;
+   nodeptr = php_sxe_get_first_node(sxe, sxe-node-node TSRMLS_CC);
+
+   sxe-xpath-node = nodeptr;
 
-   ns = xmlGetNsList((xmlDocPtr) sxe-document-ptr, (xmlNodePtr) 
sxe-node-node);
+   ns = xmlGetNsList((xmlDocPtr) sxe-document-ptr, nodeptr);
if (ns != NULL) {
while (ns[nsnbr] != NULL) {
nsnbr++;
@@ -2359,7 +2368,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.23 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.24 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug37386.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug37386.phpt
+++ php-src/ext/simplexml/tests/bug37386.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug38406.phpt

2007-02-20 Thread Antony Dovgal
tony2001Tue Feb 20 14:08:43 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug38406.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix leak and errmsg
  add test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.22r2=1.151.2.22.2.23diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.22 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.23
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.22   Tue Feb 20 13:22:41 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Feb 20 14:08:43 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.22 2007/02/20 13:22:41 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.23 2007/02/20 14:08:43 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -515,7 +515,10 @@
}
/* break is missing intentionally */
default:
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, It 
is not yet possible to assign complex types to %s, attribs ? attributes : 
properties);
+   if (member == tmp_zv) {
+   zval_dtor(tmp_zv);
+   }
+   zend_error(E_WARNING, It is not yet possible 
to assign complex types to %s, attribs ? attributes : properties);
return;
}
}
@@ -2356,7 +2359,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.22 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.23 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug38406.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug38406.phpt
+++ php-src/ext/simplexml/tests/bug38406.phpt
--TEST--
Bug #38406 (crash when assigning objects to SimpleXML attributes)
--SKIPIF--
?php if (!extension_loaded(simplexml)) print skip; ?
--FILE--
?php

$item = new SimpleXMLElement(b'something /');
$item-attribute = b'something';
var_dump($item-attribute);

$item-otherAttribute = $item-attribute;
var_dump($item-otherAttribute);

$a = array();
$item-$a = new stdclass;

echo Done\n;
?
--EXPECTF-- 
object(SimpleXMLElement)#%d (1) {
  [0]=
  string(9) something
}
object(SimpleXMLElement)#%d (1) {
  [0]=
  string(9) something
}

Notice: Array to string conversion in %s on line %d

Warning: It is not yet possible to assign complex types to properties in %s on 
line %d
Done
--UEXPECTF--
object(SimpleXMLElement)#%d (1) {
  [0]=
  unicode(9) something
}
object(SimpleXMLElement)#%d (1) {
  [0]=
  unicode(9) something
}

Notice: Array to string conversion in %s on line %d

Warning: It is not yet possible to assign complex types to properties in %s on 
line %d
Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug40451.phpt

2007-02-12 Thread Antony Dovgal
tony2001Mon Feb 12 21:06:29 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug40451.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix #40451 (addAttribute() may crash when used with non-existent child node)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.20r2=1.151.2.22.2.21diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.20 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.21
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.20   Mon Jan  1 09:36:06 2007
+++ php-src/ext/simplexml/simplexml.c   Mon Feb 12 21:06:29 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.20 2007/01/01 09:36:06 sebastian Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.21 2007/02/12 21:06:29 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1526,7 +1526,7 @@
 
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
 
-   if (node-type != XML_ELEMENT_NODE) {
+   if (node  node-type != XML_ELEMENT_NODE) {
node = node-parent;
}
 
@@ -2342,7 +2342,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.20 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.21 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug40451.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug40451.phpt
+++ php-src/ext/simplexml/tests/bug40451.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug39760.phpt

2006-12-30 Thread Rob Richards
rrichards   Sat Dec 30 15:41:17 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug39760.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix bug #39760 (cloning fails on nested SimpleXML-Object)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.18r2=1.151.2.22.2.19diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.18 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.19
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.18   Wed Nov 29 22:53:26 2006
+++ php-src/ext/simplexml/simplexml.c   Sat Dec 30 15:41:17 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.18 2006/11/29 22:53:26 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.19 2006/12/30 15:41:17 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1761,6 +1761,16 @@
clone-document-refcount++;
docp = clone-document-ptr;
}
+
+   clone-iter.isprefix = sxe-iter.isprefix;
+   if (sxe-iter.name != NULL) {
+   clone-iter.name = xmlStrdup((xmlChar *)sxe-iter.name);
+   }
+   if (sxe-iter.nsprefix != NULL) {
+   clone-iter.nsprefix = xmlStrdup((xmlChar *)sxe-iter.nsprefix);
+   }
+   clone-iter.type = sxe-iter.type;
+
if (sxe-node) {
nodep = xmlDocCopyNode(sxe-node-node, docp, 1);
}
@@ -2332,7 +2342,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.18 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.19 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug39760.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug39760.phpt
+++ php-src/ext/simplexml/tests/bug39760.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug39662.phpt

2006-11-29 Thread Rob Richards
rrichards   Wed Nov 29 08:51:36 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/simplexml/testsbug39662.phpt 
  Log:
  correct fix for bug #39662 to fix leak and tree corruption
  fix test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.16r2=1.151.2.22.2.17diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.16 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.17
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.16   Tue Nov 28 18:59:52 2006
+++ php-src/ext/simplexml/simplexml.c   Wed Nov 29 08:51:36 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.16 2006/11/28 18:59:52 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.17 2006/11/29 08:51:36 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1211,7 +1211,7 @@
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
 
if (node) {
-   if (XML_DOCUMENT_NODE == node-parent-type) {
+   if (node-parent  (XML_DOCUMENT_NODE == 
node-parent-type)) {
int bytes;
bytes = xmlSaveFile(filename, (xmlDocPtr) 
sxe-document-ptr);
if (bytes == -1) {
@@ -1240,7 +1240,7 @@
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
 
if (node) {
-   if (XML_DOCUMENT_NODE == node-parent-type) {
+   if (node-parent  (XML_DOCUMENT_NODE == node-parent-type)) {
xmlDocDumpMemory((xmlDocPtr) sxe-document-ptr, 
strval, strval_len);
RETVAL_STRINGL((char *)strval, strval_len, 1);
xmlFree(strval);
@@ -1762,7 +1762,6 @@
}
if (sxe-node) {
nodep = xmlDocCopyNode(sxe-node-node, docp, 1);
-   nodep-parent = sxe-node-node-parent;
}
 
php_libxml_increment_node_ptr((php_libxml_node_object *)clone, nodep, 
NULL TSRMLS_CC);
@@ -2332,7 +2331,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.16 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.17 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug39662.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/simplexml/tests/bug39662.phpt
diff -u php-src/ext/simplexml/tests/bug39662.phpt:1.1.2.2 
php-src/ext/simplexml/tests/bug39662.phpt:1.1.2.3
--- php-src/ext/simplexml/tests/bug39662.phpt:1.1.2.2   Tue Nov 28 18:59:53 2006
+++ php-src/ext/simplexml/tests/bug39662.phpt   Wed Nov 29 08:51:36 2006
@@ -31,9 +31,7 @@
 
 
 }
-string(55) ?xml version=1.0 encoding=utf-8?
-test
+string(15) test
 
-/test
-
+/test
 Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2006-11-29 Thread Antony Dovgal
tony2001Wed Nov 29 22:53:26 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.17r2=1.151.2.22.2.18diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.17 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.18
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.17   Wed Nov 29 08:51:36 2006
+++ php-src/ext/simplexml/simplexml.c   Wed Nov 29 22:53:26 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.17 2006/11/29 08:51:36 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.18 2006/11/29 22:53:26 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1159,6 +1159,7 @@
 
xmlXPathFreeObject(retval);
 }
+/* }}} */
 
 /* {{{ proto bool SimpleXMLElement::registerXPathNamespace(string prefix, 
string ns)
Creates a prefix/ns context for the next XPath query */
@@ -2331,7 +2332,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.17 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.18 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2006-09-06 Thread Nuno Lopes
nlopess Wed Sep  6 15:31:48 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix one more parameter (int*-int)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.14r2=1.151.2.22.2.15diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.14 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.15
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.14   Mon Aug 14 11:57:50 2006
+++ php-src/ext/simplexml/simplexml.c   Wed Sep  6 15:31:48 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.14 2006/08/14 11:57:50 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.15 2006/09/06 15:31:48 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1976,7 +1976,7 @@
 {
php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
char   *data, *ns = NULL;
-   int data_len, *ns_len = 0;
+   int data_len, ns_len = 0;
xmlDocPtr   docp;
longoptions = 0;
zend_bool   is_url = 0, isprefix = 0;
@@ -2331,7 +2331,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.14 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.15 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c /ext/simplexml/tests bug38424.phpt

2006-08-14 Thread Rob Richards
rrichards   Mon Aug 14 11:57:50 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/simplexml/testsbug38424.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  fix bug #38424 (Different attribute assignment if new or existing)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.13r2=1.151.2.22.2.14diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.13 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.14
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.13   Mon Aug  7 10:15:12 2006
+++ php-src/ext/simplexml/simplexml.c   Mon Aug 14 11:57:50 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.13 2006/08/07 10:15:12 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.14 2006/08/14 11:57:50 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -366,6 +366,8 @@
 static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
 {
zval value_copy;
+   xmlChar *buffer;
+   int buffer_len;
 
if (!value)
{
@@ -385,7 +387,20 @@
convert_to_string(value);
/* break missing intentionally */
case IS_STRING:
-   xmlNodeSetContentLen(node, (xmlChar 
*)Z_STRVAL_P(value), Z_STRLEN_P(value));
+   if (node-type == XML_ATTRIBUTE_NODE) {
+   buffer = xmlEncodeEntitiesReentrant(node-doc, 
(xmlChar *)Z_STRVAL_P(value));
+   buffer_len = xmlStrlen(buffer);
+   } else {
+   buffer = (xmlChar *)Z_STRVAL_P(value);
+   buffer_len = Z_STRLEN_P(value);
+   }
+   /* check for NULL buffer in case of memory error in 
xmlEncodeEntitiesReentrant */
+   if (buffer) {
+   xmlNodeSetContentLen(node, buffer, buffer_len);
+   if (node-type == XML_ATTRIBUTE_NODE) {
+   xmlFree(buffer);
+   }
+   }
if (value == value_copy) {
zval_dtor(value);
}
@@ -2316,7 +2331,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.13 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.14 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug38424.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug38424.phpt
+++ php-src/ext/simplexml/tests/bug38424.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2006-08-07 Thread Rob Richards
rrichards   Mon Aug  7 10:15:12 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  should be RETURN_ not RETVAL_
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.12r2=1.151.2.22.2.13diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.12 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.13
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.12   Mon Aug  7 10:09:52 2006
+++ php-src/ext/simplexml/simplexml.c   Mon Aug  7 10:15:12 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.12 2006/08/07 10:09:52 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.13 2006/08/07 10:15:12 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1200,9 +1200,9 @@
int bytes;
bytes = xmlSaveFile(filename, (xmlDocPtr) 
sxe-document-ptr);
if (bytes == -1) {
-   RETVAL_FALSE;
+   RETURN_FALSE;
} else {
-   RETVAL_TRUE;
+   RETURN_TRUE;
}
} else {
outbuf = 
xmlOutputBufferCreateFilename(filename, NULL, 0);
@@ -2316,7 +2316,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.12 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.13 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2006-08-06 Thread Antony Dovgal
tony2001Sun Aug  6 13:27:47 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  avoid extra strlen() call
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.8r2=1.151.2.22.2.9diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.8 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.9
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.8Mon Jun 26 13:41:52 2006
+++ php-src/ext/simplexml/simplexml.c   Sun Aug  6 13:27:46 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.8 2006/06/26 13:41:52 bjori Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.9 2006/08/06 13:27:46 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1229,10 +1229,11 @@
xmlNodeDumpOutput(outbuf, (xmlDocPtr) 
sxe-document-ptr, node, 0, 1, ((xmlDocPtr) sxe-document-ptr)-encoding);
xmlOutputBufferFlush(outbuf);
strval = xmlStrndup(outbuf-buffer-content, 
outbuf-buffer-use);
+   strval_len = outbuf-buffer-use;
xmlOutputBufferClose(outbuf);
}
 
-   RETVAL_STRINGL(strval, strlen(strval), 1);
+   RETVAL_STRINGL(strval, strval_len, 1);
xmlFree(strval);
} else {
RETVAL_FALSE;
@@ -2309,7 +2310,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.8 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.9 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2006-06-06 Thread Rob Richards
rrichards   Tue Jun  6 12:05:30 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  restore missing ze1 compat code
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.6r2=1.151.2.22.2.7diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.6 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.7
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.6Mon Jun  5 16:53:21 2006
+++ php-src/ext/simplexml/simplexml.c   Tue Jun  6 12:05:30 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.6 2006/06/05 16:53:21 zeev Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.7 2006/06/06 12:05:30 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1848,7 +1848,11 @@
zend_object_value rv;
 
rv.handle = zend_objects_store_put(intern, sxe_object_dtor, 
(zend_objects_free_object_storage_t)sxe_object_free_storage, sxe_object_clone 
TSRMLS_CC);
-   rv.handlers = (zend_object_handlers *) sxe_object_handlers;
+   if (EG(ze1_compatibility_mode)) {
+   rv.handlers = (zend_object_handlers *) sxe_ze1_object_handlers;
+   } else {
+   rv.handlers = (zend_object_handlers *) sxe_object_handlers;
+   }
 
return rv;
 }
@@ -2303,7 +2307,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.6 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.7 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/simplexml simplexml.c

2006-05-16 Thread Marcus Boerger
helly   Wed May 17 00:07:28 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
  Log:
  - MFH Proto fix/add
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.2r2=1.151.2.22.2.3diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.2 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.3
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.2Wed May 10 19:39:46 2006
+++ php-src/ext/simplexml/simplexml.c   Wed May 17 00:07:28 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.2 2006/05/10 19:39:46 helly Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.3 2006/05/17 00:07:28 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1049,7 +1049,7 @@
 }
 /* }}} */
 
-/* {{{ array SimpleXMLElement::xpath(string path)
+/* {{{ proto array SimpleXMLElement::xpath(string path)
Runs XPath query on the XML data */
 SXE_METHOD(xpath)
 {
@@ -1136,6 +1136,8 @@
xmlXPathFreeObject(retval);
 }
 
+/* {{{ proto bool SimpleXMLElement::registerXPathNamespace(string prefix, 
string ns)
+   Creates a prefix/ns context for the next XPath query */
 SXE_METHOD(registerXPathNamespace)
 {
php_sxe_object*sxe;
@@ -2264,7 +2266,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.2 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.151.2.22.2.3 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php