cvs: php-src / unicode-progress.txt /ext/standard array.c string.c ZendEngine2 zend_API.c
| From: | Andrei Zmievski | Date: | Wed, 20 Sep 2006 20:30:19 +0000 |
| Subject: | cvs: php-src / unicode-progress.txt /ext/standard array.c string.c ZendEngine2 zend_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-40632@lists.php.net to get a copy of this message | ||
andrei Wed Sep 20 20:30:19 2006 UTC
Modified files:
/php-src unicode-progress.txt
/ZendEngine2 zend_API.c
/php-src/ext/standard array.c string.c
Log:
Bug fixes for substr_replace().
http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.46&r2=1.47&diff_format=u
Index: php-src/unicode-progress.txt
diff -u php-src/unicode-progress.txt:1.46 php-src/unicode-progress.txt:1.47
--- php-src/unicode-progress.txt:1.46 Fri Aug 18 18:01:58 2006
+++ php-src/unicode-progress.txt Wed Sep 20 20:30:19 2006
@@ -72,16 +72,9 @@
strnatcmp(), strnatcasecmp()
Params API. The rest depends on porting of strnatcmp.c
- strrchr()
- Needs update so that it doesn't try to find half of a surrogate
- pair.
-
strtr()
Check on Derick's progress.
- substr_replace()
- Params API, test
-
wordwrap()
Upgrade, do wordwrapping on codepoint (or glyph ?) level, maybe use
additional whitespace chars instead of just space.
@@ -129,6 +122,7 @@
max()
range()
shuffle()
+ strrchr()
end(), prev(), next(), reset(), current(), key()
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.405&r2=1.406&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.405 ZendEngine2/zend_API.c:1.406
--- ZendEngine2/zend_API.c:1.405 Tue Sep 19 10:38:30 2006
+++ ZendEngine2/zend_API.c Wed Sep 20 20:30:19 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.405 2006/09/19 10:38:30 dmitry Exp $ */
+/* $Id: zend_API.c,v 1.406 2006/09/20 20:30:19 andrei Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -3460,7 +3460,7 @@
ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...)
{
va_list ap;
- int best_type = UG(unicode) ? IS_UNICODE : IS_STRING;
+ int best_type = ZEND_STR_TYPE;
int type;
if (num_args <= 0) return (zend_uchar)-1;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.385&r2=1.386&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.385 php-src/ext/standard/array.c:1.386
--- php-src/ext/standard/array.c:1.385 Tue Sep 19 09:33:02 2006
+++ php-src/ext/standard/array.c Wed Sep 20 20:30:19 2006
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.385 2006/09/19 09:33:02 tony2001 Exp $ */
+/* $Id: array.c,v 1.386 2006/09/20 20:30:19 andrei Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1690,10 +1690,6 @@
/* Unify types */
str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_P(zlow), Z_TYPE_P(zhigh));
- if (str_type == (zend_uchar)-1) {
- zend_error(E_WARNING, "Cannot mix binary and Unicode parameters");
- return;
- }
convert_to_explicit_type(zlow, str_type);
convert_to_explicit_type(zhigh, str_type);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.587&r2=1.588&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.587 php-src/ext/standard/string.c:1.588
--- php-src/ext/standard/string.c:1.587 Tue Sep 19 10:38:31 2006
+++ php-src/ext/standard/string.c Wed Sep 20 20:30:19 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.587 2006/09/19 10:38:31 dmitry Exp $ */
+/* $Id: string.c,v 1.588 2006/09/20 20:30:19 andrei Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -2319,10 +2319,6 @@
}
if (Z_TYPE_PP(haystack) != Z_TYPE_PP(needle)) {
str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(haystack), Z_TYPE_PP(needle));
- if (str_type == (zend_uchar)-1) {
- zend_error(E_WARNING, "Cannot mix binary and Unicode parameters");
- return;
- }
convert_to_explicit_type_ex(haystack, str_type);
convert_to_explicit_type_ex(needle, str_type);
}
@@ -2628,10 +2624,6 @@
}
if (Z_TYPE_PP(haystack) != Z_TYPE_PP(needle)) {
str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(haystack), Z_TYPE_PP(needle));
- if (str_type == (zend_uchar)-1) {
- zend_error(E_WARNING, "Cannot mix binary and Unicode parameters");
- return;
- }
convert_to_explicit_type_ex(haystack, str_type);
convert_to_explicit_type_ex(needle, str_type);
}
@@ -2739,10 +2731,6 @@
if (Z_TYPE_PP(zneedle) == IS_UNICODE || Z_TYPE_PP(zneedle) == IS_STRING) {
if (Z_TYPE_PP(zneedle) != Z_TYPE_PP(zhaystack)) {
str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(zhaystack), Z_TYPE_PP(zneedle));
- if (str_type == (zend_uchar)-1) {
- zend_error(E_WARNING, "Cannot mix binary and Unicode parameters");
- return;
- }
convert_to_explicit_type_ex(zhaystack, str_type);
convert_to_explicit_type_ex(zneedle, str_type);
}
@@ -3264,8 +3252,8 @@
zval **tmp_str = NULL, **tmp_from = NULL, **tmp_repl = NULL, **tmp_len= NULL;
zend_uchar str_type;
- if (argc < 3 || argc > 4 || zend_get_parameters_ex(argc, &str, &repl, &from,
&len) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|Z", &str, &repl,
&from, &len) == FAILURE) {
+ return;
}
if (Z_TYPE_PP(str) != IS_ARRAY && Z_TYPE_PP(str) != IS_UNICODE &&
@@ -3323,10 +3311,6 @@
if (tmp_repl && Z_TYPE_PP(str) != Z_TYPE_PP(tmp_repl)) {
str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(str), Z_TYPE_PP(tmp_repl));
- if (str_type == (zend_uchar)-1) {
- zend_error(E_WARNING, "Cannot mix binary and Unicode types");
- return;
- }
convert_to_explicit_type_ex(str, str_type);
convert_to_explicit_type_ex(tmp_repl, str_type);
}
@@ -3357,7 +3341,7 @@
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(str), &pos_str);
while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(str), (void **) &tmp_str, &pos_str) ==
SUCCESS) {
- if (Z_TYPE_PP(tmp_str) != IS_UNICODE && Z_TYPE_PP(tmp_str) != IS_STRING &&
Z_TYPE_PP(tmp_str) != IS_STRING) {
+ if (Z_TYPE_PP(tmp_str) != IS_UNICODE && Z_TYPE_PP(tmp_str) != IS_STRING) {
convert_to_text_ex(tmp_str);
}
@@ -3388,7 +3372,7 @@
if (Z_TYPE_PP(repl) == IS_ARRAY) {
if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(repl), (void **) &tmp_repl,
&pos_repl)) {
- if (Z_TYPE_PP(repl) != IS_UNICODE && Z_TYPE_PP(repl) != IS_STRING &&
Z_TYPE_PP(repl) != IS_STRING) {
+ if (Z_TYPE_PP(tmp_repl) != IS_UNICODE && Z_TYPE_PP(tmp_repl) != IS_STRING) {
convert_to_text_ex(tmp_repl);
}
zend_hash_move_forward_ex(Z_ARRVAL_PP(repl), &pos_repl);
@@ -3401,10 +3385,6 @@
if (tmp_repl && Z_TYPE_PP(tmp_str) != Z_TYPE_PP(tmp_repl)) {
str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(tmp_str), Z_TYPE_PP(tmp_repl));
- if (str_type == (zend_uchar)-1) {
- zend_error(E_WARNING, "Cannot mix binary and Unicode types");
- return;
- }
convert_to_explicit_type_ex(tmp_str, str_type);
convert_to_explicit_type_ex(tmp_repl, str_type);
}