Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Str::mask get wrong result when first letter equal to second letter #42867

Closed
FuS1 opened this issue Jun 18, 2022 · 3 comments
Closed

Str::mask get wrong result when first letter equal to second letter #42867

FuS1 opened this issue Jun 18, 2022 · 3 comments

Comments

@FuS1
Copy link

FuS1 commented Jun 18, 2022

  • Laravel Version: 8.83.16
  • PHP Version: 7.4.3
  • Database Driver & Version: null

Description:

Str::mask('abcde', '', 1, -1); =>"ae"
Str::mask('aaaba', '
', 1, 3); => "a
a"
Str::mask('abcde', '
', -4, 3); =>"a
e"
Str::mask('aaaba', '
', -4, 3); =>"a
**a"

But I below case will get wrong result string

Str::mask('aaaaa', '*', 1, -1); => "**aa"
Str::mask('aaaab', '
', 1,3); => "**ab"
Str::mask('aaaaa', '
', -4, 3); => "**aa"
Str::mask('aaaab', '
', -4, 3); => "***ab"

Steps To Reproduce:

@FuS1 FuS1 changed the title Str::mask get wrong result when first letter equle second letter Str::mask get wrong result when first letter equal to second letter Jun 18, 2022
@nielsdos
Copy link

This does like the occurrence of this issue: #42295 (which was fixed in 9.x) in 8.x

@BrandonSurowiec
Copy link
Contributor

You can make a PR to backport #42295 to 8.x as bug fixes are still accepted there.

@FuS1
Copy link
Author

FuS1 commented Jun 21, 2022

OK,thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants