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

[String] Fix folded in compat mode #54888

Merged
merged 1 commit into from
May 15, 2024

Conversation

smnandre
Copy link
Contributor

@smnandre smnandre commented May 11, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

(Spotted by PHPStorm)

Both those lines of code were setting $str->string value, the second line cancelling any effect of the first.

$str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC);
$str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8');

Did not know if i had to add tests, as the $compat argument is not really defined in the interface... and seems unused in the codebase 🤷‍♂️

(It also took me a bit of time to realize the dataProvider problem 😮‍💨 )

@smnandre
Copy link
Contributor Author

Failures unrelated

@OskarStark OskarStark changed the title [String] Fix folded in compat mode (minor) [String] Fix folded in compat mode May 13, 2024
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 5.4 May 15, 2024
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! (for 5.4)

@nicolas-grekas
Copy link
Member

Thank you @smnandre.

@nicolas-grekas nicolas-grekas merged commit c656ad1 into symfony:5.4 May 15, 2024
8 of 12 checks passed
@smnandre smnandre deleted the fix/string-folded branch May 15, 2024 11:29
@fabpot fabpot mentioned this pull request May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants