mirror of
https://github.com/php/php-src.git
synced 2025-01-22 11:44:09 +08:00
- MFH: These should be E_WARNING for consistency with strpos()
This commit is contained in:
parent
c2445f4122
commit
3a9a83e7bc
@ -1833,14 +1833,14 @@ PHP_FUNCTION(strrpos)
|
||||
|
||||
if (offset >= 0) {
|
||||
if (offset > haystack_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack + offset;
|
||||
e = haystack + haystack_len - needle_len;
|
||||
} else {
|
||||
if (-offset > haystack_len || offset < -INT_MAX) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -1909,7 +1909,7 @@ PHP_FUNCTION(strripos)
|
||||
Can also avoid tolower emallocs */
|
||||
if (offset >= 0) {
|
||||
if (offset > haystack_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack + offset;
|
||||
@ -1917,7 +1917,7 @@ PHP_FUNCTION(strripos)
|
||||
} else {
|
||||
p = haystack;
|
||||
if (-offset > haystack_len || offset < -INT_MAX) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
e = haystack + haystack_len + offset;
|
||||
@ -1942,7 +1942,7 @@ PHP_FUNCTION(strripos)
|
||||
if (offset > haystack_len) {
|
||||
efree(needle_dup);
|
||||
efree(haystack_dup);
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack_dup + offset;
|
||||
@ -1951,7 +1951,7 @@ PHP_FUNCTION(strripos)
|
||||
if (-offset > haystack_len || offset < -INT_MAX) {
|
||||
efree(needle_dup);
|
||||
efree(haystack_dup);
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack_dup;
|
||||
|
Loading…
Reference in New Issue
Block a user