Author: ahristov
Date: 2007-07-03 18:35:55 +0200 (Tue, 03 Jul 2007)
New Revision: 607
Modified:
trunk/php6/ext/mysqli/mysqli.c
Log:
Fix phpinfo() problem under unicode and mysqli
Modified: trunk/php6/ext/mysqli/mysqli.c
===================================================================
--- trunk/php6/ext/mysqli/mysqli.c 2007-07-03 16:34:19 UTC (rev 606)
+++ trunk/php6/ext/mysqli/mysqli.c 2007-07-03 16:35:55 UTC (rev 607)
@@ -789,19 +789,31 @@
HashPosition pos_values;
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos_values);
- while (zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&values_entry,
&pos_values) == SUCCESS) {
-#if PHP_MAJOR_VERSION >= 6
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(values),
+ (void **)&values_entry, &pos_values) == SUCCESS) {
+ TSRMLS_FETCH();
zstr string_key;
-#else
- char *string_key;
-#endif
uint string_key_len;
ulong num_key;
+ char *s = NULL;
zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &string_key, &string_key_len,
&num_key, 0, &pos_values);
convert_to_string(*values_entry);
- php_info_print_table_row(2, string_key, Z_STRVAL_PP(values_entry));
+
+ if (UG(unicode)) {
+ int s_len;
+ if (zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
+ &s, &s_len, string_key.u, string_key_len TSRMLS_CC) == SUCCESS) {
+ php_info_print_table_row(2, s, Z_STRVAL_PP(values_entry));
+ }
+ if (s) {
+ efree(s);
+ }
+ } else {
+ php_info_print_table_row(2, string_key.s, Z_STRVAL_PP(values_entry));
+ }
+
zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos_values);
}
}
| Thread |
|---|
| • PHP mysqlnd svn commit: r607 - trunk/php6/ext/mysqli | ahristov | 3 Jul |