andrei Fri Mar 17 23:00:20 2006 UTC
Modified files:
/php-src/ext/standard type.c
Log:
Make is_string() return TRUE for both Unicode and binary strings.
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/type.c?r1=1.41&r2=1.42&diff_format=u
Index: php-src/ext/standard/type.c
diff -u php-src/ext/standard/type.c:1.41 php-src/ext/standard/type.c:1.42
--- php-src/ext/standard/type.c:1.41 Fri Mar 17 14:29:05 2006
+++ php-src/ext/standard/type.c Fri Mar 17 23:00:20 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: type.c,v 1.41 2006/03/17 14:29:05 derick Exp $ */
+/* $Id: type.c,v 1.42 2006/03/17 23:00:20 andrei Exp $ */
#include "php.h"
#include "php_incomplete_class.h"
@@ -294,10 +294,21 @@
/* }}} */
/* {{{ proto bool is_string(mixed var)
- Returns true if variable is a string */
+ Returns true if variable is a Unicode or binary string */
PHP_FUNCTION(is_string)
{
- php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, UG(unicode) ? IS_UNICODE
: IS_STRING);
+ zval **arg;
+
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
{
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument
expected");
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_PP(arg) == IS_UNICODE || Z_TYPE_PP(arg) == IS_STRING) {
+ RETURN_TRUE;
+ } else {
+ RETURN_FALSE;
+ }
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php