From: Nikita Popov Date: Thu, 20 Jun 2019 14:24:31 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6aaab9adf7619c121c19701022aeb8d88f9c3bab;p=php Merge branch 'PHP-7.4' --- 6aaab9adf7619c121c19701022aeb8d88f9c3bab diff --cc ext/standard/string.c index 5c56bb4f62,78b726c87f..bf2891c690 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@@ -2057,12 -2193,14 +2057,12 @@@ PHP_FUNCTION(strripos php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); RETURN_FALSE; } - e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack) + (size_t)offset; + e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset); } /* Borrow that ord_needle buffer to avoid repeatedly tolower()ing needle */ - *ZSTR_VAL(ord_needle) = tolower(*ZSTR_VAL(needle)); + lowered = tolower(*ZSTR_VAL(needle)); while (e >= p) { - if (tolower(*e) == *ZSTR_VAL(ord_needle)) { - ZSTR_ALLOCA_FREE(ord_needle, use_heap); + if (tolower(*e) == lowered) { RETURN_LONG(e - p + (offset > 0 ? offset : 0)); } e--;