Skip to content

Commit

Permalink
Merge pull request #1779 from MarkMaldaba/patch/1777
Browse files Browse the repository at this point in the history
False positive about $encoding argument for mb_chr(), mb_ord() and mb_scrub().
  • Loading branch information
wimg authored Nov 30, 2024
2 parents 839e180 + 1b9a4e4 commit 2731628
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ class NewIconvMbstringCharsetDefaultSniff extends AbstractFunctionCallParameterS
'position' => 2,
'name' => 'encoding',
],
'mb_chr' => [
'position' => 2,
'name' => 'encoding',
],
'mb_convert_case' => [
'position' => 3,
'name' => 'encoding',
Expand All @@ -111,14 +107,6 @@ class NewIconvMbstringCharsetDefaultSniff extends AbstractFunctionCallParameterS
'position' => 3,
'name' => 'encoding',
],
'mb_ord' => [
'position' => 2,
'name' => 'encoding',
],
'mb_scrub' => [
'position' => 2,
'name' => 'encoding',
],
'mb_strcut' => [
'position' => 4,
'name' => 'encoding',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ $a = iconv_strrpos($haystack, $needle, $charset );
$a = iconv_substr($str, $offset, $length, ini_get("iconv.internal_encoding"));

$a = mb_check_encoding($var, $encoding);
$a = mb_chr($cp, $encoding);

$a = mb_convert_case( $str, MB_CASE_TITLE, mb_internal_encoding() );
$a = mb_convert_encoding( $str, $to_encoding, $from_encoding );
$a = mb_convert_kana( $str, $option, $encoding );
$a = mb_decode_numericentity($str, $convmap, $encoding, true);
$a = mb_encode_numericentity($str, $convmap, $encoding, true);
$a = mb_ord( $str, $encoding );
$a = mb_scrub( $str, $encoding );


$a = mb_strcut($str, $start, $length, $encoding);
$a = mb_stripos( $haystack, $needle, $offset, $encoding );
$a = mb_stristr( $haystack, $needle, true, $encoding );
Expand Down Expand Up @@ -49,14 +49,14 @@ $a = iconv_strrpos($haystack, $needle );
$a = iconv_substr($str, $offset);

$a = mb_check_encoding($var);
$a = MB_chr($cp);
$a = mb_convert_case( $str, MB_CASE_UPPER );

$a = MB_convert_case( $str, MB_CASE_UPPER );
$a = mb_convert_encoding( $str, $to_encoding );
$a = mb_convert_kana( $str, $option );
$a = mb_decode_numericentity($str, $convmap);
$a = mb_encode_numericentity($str, $convmap);
$a = mb_ord( $str );
$a = mb_scrub($str);


$a = mb_strcut($str, $start);
$a = mb_stripos( $haystack, $needle );
$a = mb_stristr( $haystack, $needle );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ public static function dataNewIconvMbstringCharsetDefault()
[49, 'iconv_substr'],

[51, 'mb_check_encoding'],
[52, 'MB_chr'],
[53, 'mb_convert_case'],
[53, 'MB_convert_case'],
[54, 'mb_convert_encoding', '$from_encoding'],
[55, 'mb_convert_kana'],
[56, 'mb_decode_numericentity'],
[57, 'mb_encode_numericentity'],
[58, 'mb_ord'],
[59, 'mb_scrub'],
[60, 'mb_strcut'],
[61, 'mb_stripos'],
[62, 'mb_stristr'],
Expand Down

0 comments on commit 2731628

Please sign in to comment.