cvs: ZendEngine2 / zend_API.c
| From: | Andrei Zmievski | Date: | Wed, 17 Aug 2005 18:15:24 +0000 |
| Subject: | cvs: ZendEngine2 / zend_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4030@lists.php.net to get a copy of this message | ||
andrei Wed Aug 17 14:15:24 2005 EDT
Modified files:
/ZendEngine2 zend_API.c
Log:
Disallow mixing binary and Unicode types when T specifiers are used.
http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.304&r2=1.305&ty=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.304 ZendEngine2/zend_API.c:1.305
--- ZendEngine2/zend_API.c:1.304 Wed Aug 17 13:30:02 2005
+++ ZendEngine2/zend_API.c Wed Aug 17 14:15:18 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.304 2005/08/17 17:30:02 andrei Exp $ */
+/* $Id: zend_API.c,v 1.305 2005/08/17 18:15:18 andrei Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -572,8 +572,16 @@
convert_to_string_ex(arg);
RETURN_AS_STRING(arg, p, pl, type);
} else {
- convert_to_binary_ex(arg);
- RETURN_AS_BINARY(arg, p, pl, type);
+ if (Z_TYPE_PP(arg) == IS_UNICODE) {
+ char *space;
+ char *class_name = get_active_class_name(&space TSRMLS_CC);
+ zend_error(E_WARNING, "%v%s%v() does not allow mixing binary and Unicode
parameters",
+ class_name, space, get_active_function_name(TSRMLS_C));
+ return "native or binary string";
+ } else {
+ convert_to_binary_ex(arg);
+ RETURN_AS_BINARY(arg, p, pl, type);
+ }
}
break;