diff options
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r-- | ext/standard/string.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 1bfbb7044b..59228eac4a 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1874,8 +1874,8 @@ PHP_FUNCTION(strpos) offset += (zend_long)ZSTR_LEN(haystack); } if (offset < 0 || (size_t)offset > ZSTR_LEN(haystack)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } found = (char*)php_memnstr(ZSTR_VAL(haystack) + offset, @@ -1910,8 +1910,8 @@ PHP_FUNCTION(stripos) offset += (zend_long)ZSTR_LEN(haystack); } if (offset < 0 || (size_t)offset > ZSTR_LEN(haystack)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } if (ZSTR_LEN(needle) > ZSTR_LEN(haystack)) { @@ -1952,15 +1952,15 @@ PHP_FUNCTION(strrpos) if (offset >= 0) { if ((size_t)offset > ZSTR_LEN(haystack)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } p = ZSTR_VAL(haystack) + (size_t)offset; e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack); } else { - if (offset < -INT_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { + zend_value_error("Offset not contained in string"); + return; } p = ZSTR_VAL(haystack); @@ -2002,16 +2002,16 @@ PHP_FUNCTION(strripos) char lowered; if (offset >= 0) { if ((size_t)offset > ZSTR_LEN(haystack)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } p = ZSTR_VAL(haystack) + (size_t)offset; e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack) - 1; } else { p = ZSTR_VAL(haystack); - if (offset < -INT_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { + zend_value_error("Offset not contained in string"); + return; } e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset); } @@ -2030,16 +2030,16 @@ PHP_FUNCTION(strripos) if (offset >= 0) { if ((size_t)offset > ZSTR_LEN(haystack)) { zend_string_release_ex(haystack_dup, 0); - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } p = ZSTR_VAL(haystack_dup) + offset; e = ZSTR_VAL(haystack_dup) + ZSTR_LEN(haystack); } else { - if (offset < -INT_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { + if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { zend_string_release_ex(haystack_dup, 0); - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } p = ZSTR_VAL(haystack_dup); @@ -5533,8 +5533,8 @@ PHP_FUNCTION(substr_count) offset += (zend_long)haystack_len; } if ((offset < 0) || ((size_t)offset > haystack_len)) { - php_error_docref(NULL, E_WARNING, "Offset not contained in string"); - RETURN_FALSE; + zend_value_error("Offset not contained in string"); + return; } p += offset; |