File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -2100,17 +2100,6 @@ PHP_FUNCTION(mb_strpos)
2100
2100
RETURN_FALSE ;
2101
2101
}
2102
2102
2103
- if (offset != 0 ) {
2104
- size_t slen = mbfl_strlen (& haystack );
2105
- if (offset < 0 ) {
2106
- offset += slen ;
2107
- }
2108
- if (offset < 0 || offset > slen ) {
2109
- zend_value_error ("Offset not contained in string" );
2110
- RETURN_THROWS ();
2111
- }
2112
- }
2113
-
2114
2103
n = mbfl_strpos (& haystack , & needle , offset , reverse );
2115
2104
if (!mbfl_is_error (n )) {
2116
2105
RETVAL_LONG (n );
@@ -2127,6 +2116,9 @@ PHP_FUNCTION(mb_strpos)
2127
2116
case 8 :
2128
2117
zend_value_error ("Argument is empty" );
2129
2118
RETURN_THROWS ();
2119
+ case 16 :
2120
+ zend_value_error ("Offset not contained in string" );
2121
+ RETURN_THROWS ();
2130
2122
default :
2131
2123
zend_value_error ("Unknown error in mb_strpos" );
2132
2124
RETURN_THROWS ();
You can’t perform that action at this time.
0 commit comments