Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 1 addition & 34 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,45 +2146,12 @@ PHP_FUNCTION(mb_strrpos)
{
mbfl_string haystack, needle;
zend_string *enc_name = NULL;
zval *zoffset = NULL;
zend_long offset = 0, n;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zS", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|lS", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name) == FAILURE) {
return;
}

if (zoffset) {
if (Z_TYPE_P(zoffset) == IS_STRING) {
switch (Z_STRVAL_P(zoffset)[0]) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ' ':
case '-':
case '.':
convert_to_long_ex(zoffset);
offset = Z_LVAL_P(zoffset);
break;
default :
enc_name = Z_STR_P(zoffset);
php_error_docref(NULL, E_DEPRECATED,
"Passing the encoding as third parameter is deprecated. "
"Use an explicit zero offset");
break;
}
} else {
convert_to_long_ex(zoffset);
offset = Z_LVAL_P(zoffset);
}
}

haystack.no_language = needle.no_language = MBSTRG(language);
haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
if (!haystack.encoding) {
Expand Down
14 changes: 0 additions & 14 deletions ext/mbstring/tests/mb_strrpos_encoding_3rd_param.phpt

This file was deleted.

73 changes: 0 additions & 73 deletions ext/mbstring/tests/mb_strrpos_variation5.phpt

This file was deleted.