rrichards Thu Sep 21 10:31:36 2006 UTC
Modified files:
/php-src/ext/xsl php_xsl.c xsltprocessor.c
/php-src/ext/xsl/tests bug33853.phpt
Log:
finish unicode updates
update test
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/php_xsl.c?r1=1.38&r2=1.39&diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.38 php-src/ext/xsl/php_xsl.c:1.39
--- php-src/ext/xsl/php_xsl.c:1.38 Wed Mar 29 15:08:52 2006
+++ php-src/ext/xsl/php_xsl.c Thu Sep 21 10:31:35 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xsl.c,v 1.38 2006/03/29 15:08:52 tony2001 Exp $ */
+/* $Id: php_xsl.c,v 1.39 2006/09/21 10:31:35 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -132,7 +132,7 @@
ALLOC_HASHTABLE(intern->parameter);
zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
ALLOC_HASHTABLE(intern->registered_phpfunctions);
- zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR,
0);
+ zend_u_hash_init(intern->registered_phpfunctions, 0, NULL,
ZVAL_PTR_DTOR, 0, UG(unicode));
retval.handle = zend_objects_store_put(intern,
(zend_objects_store_dtor_t)zend_objects_destroy_object,
(zend_objects_free_object_storage_t) xsl_objects_free_storage, NULL TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = &xsl_object_handlers;
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.50&r2=1.51&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.50
php-src/ext/xsl/xsltprocessor.c:1.51
--- php-src/ext/xsl/xsltprocessor.c:1.50 Fri Sep 8 13:04:29 2006
+++ php-src/ext/xsl/xsltprocessor.c Thu Sep 21 10:31:35 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsltprocessor.c,v 1.50 2006/09/08 13:04:29 rrichards Exp $ */
+/* $Id: xsltprocessor.c,v 1.51 2006/09/21 10:31:35 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -255,9 +255,9 @@
return;
}
INIT_PZVAL(&handler);
- ZVAL_STRING(&handler, obj->stringval, 1);
+ ZVAL_XML_STRING(&handler, obj->stringval, 1);
xmlXPathFreeObject(obj);
-
+
fci.function_name = &handler;
fci.symbol_table = NULL;
fci.object_pp = NULL;
@@ -274,8 +274,8 @@
} else {
result = zend_call_function(&fci, NULL TSRMLS_CC);
if (result == FAILURE) {
- if (Z_TYPE(handler) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Unable to call handler %s()", Z_STRVAL_P(&handler));
+ if (Z_TYPE(callable) == IS_STRING || Z_TYPE(callable)
== IS_UNICODE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Unable to call handler '%R()'.", Z_TYPE(callable), Z_UNIVAL(callable));
}
/* retval is == NULL, when an exception occured, don't report
anything, because PHP itself will handle that */
} else if (retval == NULL) {
@@ -730,7 +730,7 @@
}
/* }}} end xsl_xsltprocessor_remove_parameter */
-/* {{{ proto void xsl_xsltprocessor_register_php_functions();
+/* {{{ proto void xsl_xsltprocessor_register_php_functions() U
*/
PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
{
@@ -738,7 +738,8 @@
xsl_object *intern;
zval *array_value, **entry, *new_string;
int name_len = 0;
- char *name;
+ zstr name;
+ zend_uchar name_type;
DOM_GET_THIS(id);
@@ -747,24 +748,21 @@
zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value));
while (zend_hash_get_current_data(Z_ARRVAL_P(array_value),
(void **)&entry) == SUCCESS) {
- SEPARATE_ZVAL(entry);
- convert_to_string_with_converter(*entry, UG(utf8_conv));
-
MAKE_STD_ZVAL(new_string);
ZVAL_LONG(new_string,1);
- zend_hash_update(intern->registered_phpfunctions,
Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &new_string, sizeof(zval*), NULL);
+ zend_u_hash_update(intern->registered_phpfunctions,
Z_TYPE_PP(entry), Z_UNIVAL_PP(entry), Z_UNILEN_PP(entry) + 1, &new_string,
sizeof(zval*), NULL);
zend_hash_move_forward(Z_ARRVAL_P(array_value));
}
intern->registerPhpFunctions = 2;
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &name_type) == SUCCESS) {
intern = (xsl_object *)zend_object_store_get_object(id
TSRMLS_CC);
MAKE_STD_ZVAL(new_string);
ZVAL_LONG(new_string,1);
- zend_hash_update(intern->registered_phpfunctions, name,
name_len + 1, &new_string, sizeof(zval*), NULL);
+ zend_u_hash_update(intern->registered_phpfunctions, name_type,
name, name_len + 1, &new_string, sizeof(zval*), NULL);
intern->registerPhpFunctions = 2;
} else {
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/tests/bug33853.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/xsl/tests/bug33853.phpt
diff -u php-src/ext/xsl/tests/bug33853.phpt:1.2
php-src/ext/xsl/tests/bug33853.phpt:1.3
--- php-src/ext/xsl/tests/bug33853.phpt:1.2 Thu Sep 7 21:57:26 2006
+++ php-src/ext/xsl/tests/bug33853.phpt Thu Sep 21 10:31:36 2006
@@ -31,3 +31,6 @@
===DONE===
--EXPECT--
string(4) "TeSt"
+
+--UEXPECT--
+unicode(4) "TeSt"
\ No newline at end of file
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php