diff options
author | Pierre Joye <pajoye@php.net> | 2007-05-14 09:23:49 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2007-05-14 09:23:49 +0000 |
commit | 19d1d24d60f1c6fb8caf2356f061016925ee4f09 (patch) | |
tree | 58366aee2ac3b36a960a02ea94d77e6abbfc6638 /ext/xmlwriter/php_xmlwriter.c | |
parent | f752fd48365b15da3b38aab536e1a239cb401895 (diff) | |
download | php-git-19d1d24d60f1c6fb8caf2356f061016925ee4f09.tar.gz |
- [@DOC] MFH: #41326, better fix. It restores BC and allows both canonical
and short form:
- when $content is given, the closing tag will be generated (even for empty
string)
- when $content is ignored or NULL is given, the short form will be used
Diffstat (limited to 'ext/xmlwriter/php_xmlwriter.c')
-rw-r--r-- | ext/xmlwriter/php_xmlwriter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 1d8fd99961..45a0d912c1 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -769,7 +769,7 @@ static PHP_FUNCTION(xmlwriter_write_element) zval *this = getThis(); if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &name, &name_len, &content, &content_len) == FAILURE) { return; } @@ -777,7 +777,7 @@ static PHP_FUNCTION(xmlwriter_write_element) } else #endif { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!", &pind, &name, &name_len, &content, &content_len) == FAILURE) { return; } @@ -789,7 +789,7 @@ static PHP_FUNCTION(xmlwriter_write_element) ptr = intern->ptr; if (ptr) { - if (!content || content_len < 1) { + if (!content) { retval = xmlTextWriterStartElement(ptr, (xmlChar *)name); if (retval == -1) { RETURN_FALSE; @@ -824,7 +824,7 @@ static PHP_FUNCTION(xmlwriter_write_element_ns) zval *this = getThis(); if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!|s", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!|s!", &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { return; } @@ -832,7 +832,7 @@ static PHP_FUNCTION(xmlwriter_write_element_ns) } else #endif { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!|s", &pind, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!|s!", &pind, &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { return; } @@ -844,7 +844,7 @@ static PHP_FUNCTION(xmlwriter_write_element_ns) ptr = intern->ptr; if (ptr) { - if (!content || content_len < 1) { + if (!content) { retval = xmlTextWriterStartElementNS(ptr,(xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri); if (retval == -1) { RETURN_FALSE; |