Re: cvs: php-src /ext/xmlreader php_xmlreader.c
| From: | Andrei Zmievski | Date: | Fri, 21 Jul 2006 01:20:08 +0000 |
| Subject: | Re: cvs: php-src /ext/xmlreader php_xmlreader.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-39422@lists.php.net to get a copy of this message | ||
You're right. I guess it was just a bit too subtle for me after the day of staring at the code. :)
-Andrei
On Jul 20, 2006, at 6:20 PM, Rob Richards wrote:
When type is XMLREADER_LOAD_STRING, it uses the "s" parameter, so wouldn't the source_type be IS_STRING (from the initial variable declaration) causing it to never be encoded? Rob Andrei Zmievski wrote:So you're encoding the source even when type is XMLREADER_LOAD_STRING? -Andrei On Jul 20, 2006, at 5:57 PM, Rob Richards wrote:--PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php+ if (type == XMLREADER_LOAD_FILE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t!", &source, &source_len, &source_type) == FAILURE) { + return; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) { + return; + } }if (source != NULL && !source_len) {@@ -520,10 +527,18 @@intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern && intern->ptr) { if (source) { + if (source_type == IS_UNICODE) { + if (php_stream_path_encode(NULL, &source, &source_len, (UChar*)source, source_len, REPORT_ERRORS, NULL) == FAILURE) { + RETURN_FALSE; + } + }