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

2008-05-23 Thread Ilia Alshanetsky
iliaa   Fri May 23 15:46:55 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
/php-srcNEWS 
  Log:
  
  When dumping entire document to file via asXml() don't lose the encoding
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.40&r2=1.151.2.22.2.41&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.40 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.41
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.40   Mon May  5 23:00:13 2008
+++ php-src/ext/simplexml/simplexml.c   Fri May 23 15:46:54 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.40 2008/05/05 23:00:13 iliaa Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.41 2008/05/23 15:46:54 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1323,7 +1323,7 @@
 
if (node) {
if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) {
-   xmlDocDumpMemory((xmlDocPtr) sxe->document->ptr, 
&strval, &strval_len);
+   xmlDocDumpMemoryEnc((xmlDocPtr) sxe->document->ptr, 
&strval, &strval_len, ((xmlDocPtr) sxe->document->ptr)->encoding);
RETVAL_STRINGL((char *)strval, strval_len, 1);
xmlFree(strval);
} else {
@@ -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.40 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.41 $");
php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1159&r2=1.2027.2.547.2.1160&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1159 php-src/NEWS:1.2027.2.547.2.1160
--- php-src/NEWS:1.2027.2.547.2.1159Mon May 19 15:18:39 2008
+++ php-src/NEWSFri May 23 15:46:54 2008
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? ??? 2008, PHP 5.2.7
+- When dumping entire document to file via asXml() don't lose the encoding.
+  (Ilia)
 - Fixed a crash inside PDO when trying instantiate PDORow manually (Felipe)
 - Fixed build failure of ext/mysqli with libmysql 6.0 - missing rpl
   functions. (Andrey)



-- 
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) / NEWS /ext/simplexml simplexml.c

2008-05-05 Thread Ilia Alshanetsky
iliaa   Mon May  5 23:00:13 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  
  MFB: Fixed bug #44798 (Memory leak assigning value to attribute).
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1150&r2=1.2027.2.547.2.1151&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1150 php-src/NEWS:1.2027.2.547.2.1151
--- php-src/NEWS:1.2027.2.547.2.1150Mon May  5 12:30:38 2008
+++ php-src/NEWSMon May  5 23:00:12 2008
@@ -5,6 +5,7 @@
   functions. (Andrey)
 - Fixed bug #44891 Memory leak using registerPHPFunctions and XSLT Variable 
   as function parameter. (Rob)
+- Fixed bug #44798 (Memory leak assigning value to attribute). (Ilia)
 
 01 May 2008, PHP 5.2.6
 - Fixed two possible crashes inside posix extension (Tony)
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.39&r2=1.151.2.22.2.40&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.39 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.40
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.39   Thu Mar 20 16:48:45 2008
+++ php-src/ext/simplexml/simplexml.c   Mon May  5 23:00:13 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.39 2008/03/20 16:48:45 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.40 2008/05/05 23:00:13 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -695,11 +695,12 @@
convert_to_string(member);
name = Z_STRVAL_P(member);
node = sxe_get_element_by_name(sxe, node, &name, &type TSRMLS_CC);
-   if (!node) {
-   sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC);
-   type = SXE_ITER_NONE;
-   name = NULL;
+   if (node) {
+   return NULL;
}
+   sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC);
+   type = SXE_ITER_NONE;
+   name = NULL;
MAKE_STD_ZVAL(return_value);
_node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix, 
sxe->iter.isprefix TSRMLS_CC);
 
@@ -2445,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.39 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.40 $");
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) / NEWS /ext/simplexml simplexml.c

2007-07-03 Thread Sara Golemon
pollita Wed Jul  4 05:05:58 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
/php-srcNEWS 
  Log:
  MFH (r-1.240)
  Fix behavior of empty($sxe->element) and empty($sxe['prop'])
  when used on empty elements properties (apply PHP emptiness rules)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.31&r2=1.151.2.22.2.32&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.31 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.32
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.31   Tue Jul  3 14:55:53 2007
+++ php-src/ext/simplexml/simplexml.c   Wed Jul  4 05:05:57 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.31 2007/07/03 14:55:53 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.32 2007/07/04 05:05:57 pollita Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -787,6 +787,11 @@
attr = attr->next;
}
}
+   if (exists && check_empty == 1 &&
+   (!attr->children || !attr->children->content || 
!attr->children->content[0] || !xmlStrcmp(attr->children->content, "0")) ) {
+   /* Attribute with no content in it's text node 
*/
+   exists = 0;
+   }
}
 
if (elements) {
@@ -809,6 +814,11 @@
}
if (node) {
exists = 1;
+if (check_empty == 1 && 
+   (!node->children || 
(node->children->type == XML_TEXT_NODE && !node->children->next &&
+   (!node->children->content || 
!node->children->content[0] || !xmlStrcmp(node->children->content, "0" ) {
+   exists = 0;
+   }
}
}
}
@@ -2420,7 +2430,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.31 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.32 $");
php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.813&r2=1.2027.2.547.2.814&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.813 php-src/NEWS:1.2027.2.547.2.814
--- php-src/NEWS:1.2027.2.547.2.813 Tue Jul  3 15:03:16 2007
+++ php-src/NEWSWed Jul  4 05:05:57 2007
@@ -37,6 +37,7 @@
   (Ilia)
 - Fixed INFILE LOCAL option handling with MySQL extensions not to be allowed 
   when open_basedir or safe_mode is active. (Stas)
+- Faxed SimpleXML's behavior when used with empty(). (Sara)
 
 - Fixed PECL Bug #11345 (PDO_OCI crash after National language Support
   "NLS" environment initialization error) (Chris Jones)

-- 
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) / NEWS /ext/simplexml simplexml.c /ext/simplexml/tests bug41582.phpt

2007-06-05 Thread Antony Dovgal
tony2001Tue Jun  5 10:03:13 2007 UTC

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix #41582 (SimpleXML crashes when accessing newly created element)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.758&r2=1.2027.2.547.2.759&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.758 php-src/NEWS:1.2027.2.547.2.759
--- php-src/NEWS:1.2027.2.547.2.758 Tue Jun  5 07:49:00 2007
+++ php-src/NEWSTue Jun  5 10:03:12 2007
@@ -10,6 +10,8 @@
   exists (pecl bug #11216) (Pierre)
   GD_RELEASE_VERSION, GD_EXTRA_VERSION and GD_VERSION_STRING. (Pierre)
 - Fixed bug #41594 (Statement cache is flushed too frequently). (Tony)
+- Fixed bug #41582 (SimpleXML crashes when accessing newly created element).
+  (Tony)
 - Fixed bug #41576 (configure failure when using --without-apxs or some
   other SAPIs disabling options). (Jani)
 - Fixed bug #41567 (json_encode() double conversion is inconsistent with
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.26&r2=1.151.2.22.2.27&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.26 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.27
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.26   Tue Apr 24 14:11:28 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jun  5 10:03:12 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.26 2007/04/24 14:11:28 iliaa Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.27 2007/06/05 10:03:12 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -238,7 +238,7 @@
 
 /* {{{ sxe_prop_dim_read()
  */
-static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool 
elements, zend_bool attribs, zend_bool silent TSRMLS_DC)
+static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool 
elements, zend_bool attribs, int type TSRMLS_DC)
 {
zval   *return_value;
php_sxe_object *sxe;
@@ -249,6 +249,12 @@
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) {
@@ -357,7 +363,7 @@
  */
 static zval * sxe_property_read(zval *object, zval *member, int type TSRMLS_DC)
 {
-   return sxe_prop_dim_read(object, member, 1, 0, type == BP_VAR_IS 
TSRMLS_CC);
+   return sxe_prop_dim_read(object, member, 1, 0, type TSRMLS_CC);
 }
 /* }}} */
 
@@ -365,7 +371,7 @@
  */
 static zval * sxe_dimension_read(zval *object, zval *offset, int type 
TSRMLS_DC)
 {
-   return sxe_prop_dim_read(object, offset, 0, 1, 0 TSRMLS_CC);
+   return sxe_prop_dim_read(object, offset, 0, 1, type TSRMLS_CC);
 }
 /* }}} */
 
@@ -2368,7 +2374,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.26 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.27 $");
php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug41582.phpt?view=markup&rev=1.1
Index: php-src/ext/simplexml/tests/bug41582.phpt
+++ php-src/ext/simplexml/tests/bug41582.phpt
--TEST--
Bug #41582 (SimpleXML crashes when accessing newly created element)
--FILE--
');

$xml->movie[]->characters->character[0]->name = b'Miss Coder';

var_dump($xml->asXml());

echo "Done\n";
?>
--EXPECTF-- 
Fatal error: Cannot use object of type stdClass as array in %s on line %d

-- 
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) / NEWS /ext/simplexml simplexml.c /ext/simplexml/tests bug41175.phpt

2007-04-24 Thread Ilia Alshanetsky
iliaa   Tue Apr 24 13:54:59 2007 UTC

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  
  Fixed bug #41175 (addAttribute() fails to add an attribute with an empty
  value). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.661&r2=1.2027.2.547.2.662&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.661 php-src/NEWS:1.2027.2.547.2.662
--- php-src/NEWS:1.2027.2.547.2.661 Mon Apr 23 15:23:37 2007
+++ php-src/NEWSTue Apr 24 13:54:59 2007
@@ -4,6 +4,8 @@
 - Fixed commandline handling fro CLI and CGI. (Marcus, Johannes)
 - Upgraded SQLite 3 to version 3.3.16 (Ilia)
 - Updated timezone database to version 2007.5. (Derick)
+- Fixed bug #41175 (addAttribute() fails to add an attribute with an empty
+  value). (Ilia)
 - Fixed bug #41159 (mysql_pconnect() hash does not account for connect
   flags). (Ilia)
 - Fixed bug #41121 (range() overflow handling for large numbers on 32bit
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.24&r2=1.151.2.22.2.25&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.24 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.25
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.24   Mon Mar 26 20:14:58 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Apr 24 13:54:59 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.24 2007/03/26 20:14:58 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.25 2007/04/24 13:54:59 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1542,7 +1542,7 @@
return;
}
 
-   if (qname_len == 0 || value_len == 0) {
+   if (qname_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name and 
value are 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.24 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.25 $");
php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug41175.phpt?view=markup&rev=1.1
Index: php-src/ext/simplexml/tests/bug41175.phpt
+++ php-src/ext/simplexml/tests/bug41175.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) / NEWS /ext/simplexml simplexml.c

2007-02-20 Thread Antony Dovgal
tony2001Tue Feb 20 13:22:41 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/simplexml  simplexml.c 
/php-srcNEWS 
  Log:
  MFH: fix #38406 (crash when assigning objects to SimpleXML attributes)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.21&r2=1.151.2.22.2.22&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.21 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.22
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.21   Mon Feb 12 21:06:29 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Feb 20 13:22:41 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.21 2007/02/12 21:06:29 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.22 2007/02/20 13:22:41 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -56,6 +56,7 @@
 static zend_object_value php_sxe_register_object(php_sxe_object * TSRMLS_DC);
 static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data 
TSRMLS_DC);
 static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, 
int use_data TSRMLS_DC);
+static zval *sxe_get_value(zval *z TSRMLS_DC);
 
 /* {{{ _node_as_zval()
  */
@@ -427,6 +428,7 @@
int is_attr = 0;
int nodendx = 0;
int test = 0;
+   int new_value = 0;
longcnt;
zvaltmp_zv, trim_zv, value_copy;
 
@@ -504,8 +506,17 @@
break;
case IS_STRING:
break;
+   case IS_OBJECT:
+   if (Z_OBJCE_P(value) == sxe_class_entry) {
+   value = sxe_get_value(value TSRMLS_CC);
+   INIT_PZVAL(value);
+   new_value = 1;
+   break;
+   }
+   /* 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");
+   return;
}
}
 
@@ -594,6 +605,9 @@
if (value && value == &value_copy) {
zval_dtor(value);
}
+   if (new_value) {
+   zval_ptr_dtor(&value);
+   }
 }
 /* }}} */
 
@@ -2342,7 +2356,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.21 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.22 $");
php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.552&r2=1.2027.2.547.2.553&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.552 php-src/NEWS:1.2027.2.547.2.553
--- php-src/NEWS:1.2027.2.547.2.552 Tue Feb 20 13:09:54 2007
+++ php-src/NEWSTue Feb 20 13:22:41 2007
@@ -39,6 +39,7 @@
 - Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony)
 - Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus)
 - Fixed bug #39322 (proc_terminate() destroys process resource). (Nuno)
+- Fixed bug #38406 (crash when assigning objects to SimpleXML attributes). 
(Tony)
 - Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection). (Nuno)
 - Fixed bug #36496 (SSL support in imap_open() not working on Windows). (Edin)
 - Fixed bug #34794 (proc_close() hangs when used with two processes).

-- 
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) / NEWS /ext/simplexml simplexml.c /ext/simplexml/tests bug39662.phpt

2006-11-28 Thread Antony Dovgal
tony2001Tue Nov 28 18:59:53 2006 UTC

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  MFH: fix #39662 (Segfault when calling asXML() of a cloned SimpleXMLElement)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.380&r2=1.2027.2.547.2.381&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.380 php-src/NEWS:1.2027.2.547.2.381
--- php-src/NEWS:1.2027.2.547.2.380 Tue Nov 28 16:27:53 2006
+++ php-src/NEWSTue Nov 28 18:59:52 2006
@@ -43,6 +43,8 @@
 php_filter.h).
 - Fixed wrong signature initialization in imagepng (Takeshi Abe)
 - Added optimization for imageline with horizontal and vertial lines (Pierre)
+- Fixed bug #39662 (Segfault when calling asXML() of a cloned 
SimpleXMLElement).
+  (Tony)
 - Fixed bug #39656 (crash when calling fetch() on a PDO statment object
   after closeCursor()). (Ilia, Tony)
 - Fixed bug #39653 (ext/dba doesn't check for db-4.5 and db-4.4 when db4 
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.15&r2=1.151.2.22.2.16&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.15 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.16
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.15   Wed Sep  6 15:31:48 2006
+++ php-src/ext/simplexml/simplexml.c   Tue Nov 28 18:59:52 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.15 2006/09/06 15:31:48 nlopess Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.16 2006/11/28 18:59:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1762,6 +1762,7 @@
}
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);
@@ -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.15 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.16 $");
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?view=markup&rev=1.1
Index: php-src/ext/simplexml/tests/bug39662.phpt
+++ php-src/ext/simplexml/tests/bug39662.phpt
--TEST--
Bug #39662 (Segfault when calling asXML() of a cloned SimpleXMLElement)
--SKIPIF--

--FILE--



';

$root = simplexml_load_string($xml);
$clone = clone $root;
var_dump($root);
var_dump($clone);
var_dump($clone->asXML());

echo "Done\n";
?>
--EXPECTF-- 
object(SimpleXMLElement)#%d (1) {
  [0]=>
  string(2) "

"
}
object(SimpleXMLElement)#%d (1) {
  [0]=>
  string(2) "

"
}
string(55) "



"
Done
--UEXPECTF--
object(SimpleXMLElement)#%d (1) {
  [0]=>
  unicode(2) "

"
}
object(SimpleXMLElement)#%d (1) {
  [0]=>
  unicode(2) "

"
}
string(55) "



"
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) / NEWS /ext/simplexml simplexml.c

2006-08-06 Thread Christian Stocker
chregu  Sun Aug  6 19:38:45 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  
  Fix #38354 (Unwanted reformatting of XML when using AsXML)   
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.184&r2=1.2027.2.547.2.185&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.184 php-src/NEWS:1.2027.2.547.2.185
--- php-src/NEWS:1.2027.2.547.2.184 Sun Aug  6 17:41:51 2006
+++ php-src/NEWSSun Aug  6 19:38:45 2006
@@ -30,6 +30,7 @@
 - Fixed phpinfo() cutoff of variables at \0. (Ilia)
 - Fixed a bug in the filter extension that prevented magic_quotes_gpc from
   being applied when RAW filter is used. (Ilia)
+- Fixed bug #38354 (Unwanted reformatting of XML when using AsXML). (Christian)
 - Fixed bug #38347 (Segmentation fault when using foreach with an 
unknown/empty 
   SimpleXMLElement). (Tony)
 - Fixed bug #38322 (reading past array in sscanf() leads to arbitary code 
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.10&r2=1.151.2.22.2.11&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.10 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.11
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.10   Sun Aug  6 17:41:51 2006
+++ php-src/ext/simplexml/simplexml.c   Sun Aug  6 19:38:45 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.10 2006/08/06 17:41:51 tony2001 Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.11 2006/08/06 19:38:45 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1205,7 +1205,7 @@
RETURN_FALSE;
}
 
-   xmlNodeDumpOutput(outbuf, (xmlDocPtr) 
sxe->document->ptr, node, 0, 1, NULL);
+   xmlNodeDumpOutput(outbuf, (xmlDocPtr) 
sxe->document->ptr, node, 0, 0, NULL);
xmlOutputBufferClose(outbuf);
RETURN_TRUE;
}
@@ -1229,7 +1229,7 @@
RETURN_FALSE;
}
 
-   xmlNodeDumpOutput(outbuf, (xmlDocPtr) 
sxe->document->ptr, node, 0, 1, ((xmlDocPtr) sxe->document->ptr)->encoding);
+   xmlNodeDumpOutput(outbuf, (xmlDocPtr) 
sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
xmlOutputBufferFlush(outbuf);
strval = xmlStrndup(outbuf->buffer->content, 
outbuf->buffer->use);
strval_len = outbuf->buffer->use;
@@ -2313,7 +2313,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.10 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.11 $");
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) / NEWS /ext/simplexml simplexml.c

2006-06-26 Thread Hannes Magnusson
bjori   Mon Jun 26 13:41:52 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML()
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.95&r2=1.2027.2.547.2.96&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.95 php-src/NEWS:1.2027.2.547.2.96
--- php-src/NEWS:1.2027.2.547.2.95  Mon Jun 26 13:23:46 2006
+++ php-src/NEWSMon Jun 26 13:41:52 2006
@@ -59,6 +59,8 @@
 - Added memory_get_peak_usage() function for retrieving peak memory usage of
   a PHP script. (Ilia)
 - Added pg_field_table() function. (Edin)
+- Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML().
+  (Hannes)
 
 - Optimized zend_try/zend_catch macros by eliminating memcpy(3). (Dmitry)
 - Optimized require_once() and include_once() by eliminating fopen(3)
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.7&r2=1.151.2.22.2.8&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.7 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.8
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.7Tue Jun  6 12:05:30 2006
+++ php-src/ext/simplexml/simplexml.c   Mon Jun 26 13:41:52 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.7 2006/06/06 12:05:30 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.8 2006/06/26 13:41:52 bjori Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -48,6 +48,7 @@
 }
 
 #define SXE_ME(func, arg_info, flags) PHP_ME(simplexml_element, func, 
arg_info, flags)
+#define SXE_MALIAS(func, alias, arg_info, flags) PHP_MALIAS(simplexml_element, 
func, alias, arg_info, flags)
 
 #define SXE_METHOD(func) PHP_METHOD(simplexml_element, func)
 
@@ -2246,6 +2247,7 @@
 static zend_function_entry sxe_functions[] = {
SXE_ME(__construct,NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) /* 
must be called */
SXE_ME(asXML,  NULL, ZEND_ACC_PUBLIC)
+   SXE_MALIAS(saveXML, asXML, NULL, ZEND_ACC_PUBLIC)
SXE_ME(xpath,  NULL, ZEND_ACC_PUBLIC)
SXE_ME(registerXPathNamespace, NULL, ZEND_ACC_PUBLIC)
SXE_ME(attributes, NULL, ZEND_ACC_PUBLIC)
@@ -2307,7 +2309,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.7 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.8 $");
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) / NEWS /ext/simplexml simplexml.c /ext/simplexml/tests bug37565.phpt

2006-05-23 Thread Marcus Boerger
helly   Tue May 23 21:58:45 2006 UTC

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/simplexml  simplexml.c 
  Log:
  - MFH Bugfix #37565
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.39&r2=1.2027.2.547.2.40&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.39 php-src/NEWS:1.2027.2.547.2.40
--- php-src/NEWS:1.2027.2.547.2.39  Mon May 22 19:04:19 2006
+++ php-src/NEWSTue May 23 21:58:44 2006
@@ -43,6 +43,8 @@
 - Added pg_field_table() function. (Edin)
 - Added implementation of curl_multi_info_read(). (Brian)
 - Added RFC2397 (data: stream) support. (Marcus)
+- Fixed bug #37565 (Using reflection::export with simplexml causing a crash).
+  (Marcus)
 - Fixed bug #37514 (strtotime doesn't assume year correctly). (Derick)
 - Fixed bug #37510 (session_regenerate_id changes session_id() even on 
   failure). (Hannes)
http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.3&r2=1.151.2.22.2.4&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.3 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.4
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.3Wed May 17 00:07:28 2006
+++ php-src/ext/simplexml/simplexml.c   Tue May 23 21:58:44 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.3 2006/05/17 00:07:28 helly Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.4 2006/05/23 21:58:44 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1837,12 +1837,10 @@
char   *filename;
int filename_len;
xmlDocPtr   docp;
-   char   *classname = "";
-   int classname_len = 0;
longoptions = 0;
zend_class_entry *ce= sxe_class_entry;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &filename, 
&filename_len, &classname, &classname_len, &options) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Cl", &filename, 
&filename_len, &ce, &options) == FAILURE) {
return;
}
 
@@ -1852,14 +1850,6 @@
RETURN_FALSE;
}
 
-   if (classname_len) {
-   zend_class_entry **pce;
-   if (zend_lookup_class(classname, classname_len, &pce TSRMLS_CC) 
== FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s 
does not exist", classname);
-   }
-   ce = *pce;
-   }
-
sxe = php_sxe_object_new(ce TSRMLS_CC);
php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp 
TSRMLS_CC);
php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, 
xmlDocGetRootElement(docp), NULL TSRMLS_CC);
@@ -1877,12 +1867,10 @@
char   *data;
int data_len;
xmlDocPtr   docp;
-   char   *classname = "";
-   int classname_len = 0;
longoptions = 0;
zend_class_entry *ce= sxe_class_entry;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &data, 
&data_len, &classname, &classname_len, &options) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Cl", &data, 
&data_len, &ce, &options) == FAILURE) {
return;
}
 
@@ -1892,14 +1880,6 @@
RETURN_FALSE;
}
 
-   if (classname_len) {
-   zend_class_entry **pce;
-   if (zend_lookup_class(classname, classname_len, &pce TSRMLS_CC) 
== FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s 
does not exist", classname);
-   }
-   ce = *pce;
-   }
-
sxe = php_sxe_object_new(ce TSRMLS_CC);
php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp 
TSRMLS_CC);
php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, 
xmlDocGetRootElement(docp), NULL TSRMLS_CC);
@@ -2131,11 +2111,9 @@
zval *node;
php_libxml_node_object *object;
xmlNodePtr  nodep = NULL;
-   char   *classname = "";
-   int classname_len = 0;
zend_class_entry *ce= sxe_class_entry;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|s", &node, 
&classname, &classname_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|C", &node, &ce) 
== FAILURE) {
return;
}
 
@@ -2154,14 +2132,6 @@
}
 
if (nodep && nodep->type == XML_ELEMENT_NODE) {
-   if (classname_len) {
-   zend_class_entry **pce;
-   if (zend_lookup_class(classname, classname_len, &pce 
TSRMLS_CC) == FAILURE) {
-