]> granicus.if.org Git - php/commitdiff
hebrev/hebrevc: Don't return false for empty string
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 28 May 2019 11:07:03 +0000 (13:07 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 28 May 2019 11:12:38 +0000 (13:12 +0200)
There is nothing special about the empty string in this context,
we should pass it through unchanged.

ext/opcache/Optimizer/zend_func_info.c
ext/standard/string.c

index dfb4451b2e0f5b5009fd53a22c05e70ce22ea4f6..ae33da0022a0da4597e44a64c9b730c587181c75 100644 (file)
@@ -189,8 +189,8 @@ static const func_info_t func_infos[] = {
        F0("strrpos",                      MAY_BE_FALSE | MAY_BE_LONG),
        F0("strripos",                     MAY_BE_FALSE | MAY_BE_LONG),
        F1("strrev",                       MAY_BE_STRING),
-       F1("hebrev",                       MAY_BE_FALSE | MAY_BE_STRING),
-       F1("hebrevc",                      MAY_BE_FALSE | MAY_BE_STRING),
+       F1("hebrev",                       MAY_BE_STRING),
+       F1("hebrevc",                      MAY_BE_STRING),
        FN("nl2br",                        MAY_BE_STRING),
        F1("basename",                     MAY_BE_STRING),
        F1("dirname",                      MAY_BE_NULL | MAY_BE_STRING),
index 757dcec8004f8beeba6bdaf69e0d3ccb04ddd7ce..39739c82c0af7a42a070e57a9797cc158ccc1cac 100644 (file)
@@ -4345,7 +4345,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
        ZEND_PARSE_PARAMETERS_END();
 
        if (str_len == 0) {
-               RETURN_FALSE;
+               RETURN_EMPTY_STRING();
        }
 
        tmp = str;