From: Andrei Zmievski Date: Tue, 2 May 2006 21:49:16 +0000 (+0000) Subject: FALSE on empty string. X-Git-Tag: BEFORE_NEW_OUTPUT_API~330 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aaed3ca1b0e89588ea517c075823c24b9c6e6f2b;p=php FALSE on empty string. --- diff --git a/ext/unicode/property.c b/ext/unicode/property.c index c9ec9652e0..61df1b7b3a 100644 --- a/ext/unicode/property.c +++ b/ext/unicode/property.c @@ -32,6 +32,10 @@ static void check_property_impl(INTERNAL_FUNCTION_PARAMETERS, prop_check_func_t return; } + if (str_len == 0) { + RETURN_FALSE; + } + while (offset < str_len && result) { U16_NEXT(str, offset, str_len, ch); result = checker(ch); @@ -40,9 +44,8 @@ static void check_property_impl(INTERNAL_FUNCTION_PARAMETERS, prop_check_func_t RETURN_BOOL(result); } -/* - * C/POSIX migration functinos - */ + +/* {{{ C/POSIX migration functions */ PHP_FUNCTION(unicode_is_lower) { @@ -104,6 +107,8 @@ PHP_FUNCTION(unicode_is_print) check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isprint); } +/* }}} */ + /* * Local variables: