For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > August 2005 > cvs: ZendEngine2 / zend_API.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_API.c
Andrei Zmievski

2005-08-17, 5:00 pm

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/ZendEng...4&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;

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com