-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Avoid ord deprecation notice in PHP 8.5 #4724
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
Conversation
Change the one usage of ord() in Twig where a multibyte character can trigger the new deprecation in PHP 8.5, which is in the `html_attr` escape functionality, previously leading to: ord(): Providing a string that is not one byte long is deprecated. Use ord($str[0]) instead"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses a PHP 8.5 deprecation warning by updating the ord() function call in the html_attr escaping strategy to explicitly access the first byte of the string using array notation.
- Fixes PHP 8.5 deprecation warning when
ord()receives multibyte characters - Changes
\ord($chr)to\ord($chr[0])in the html_attr escaper callback - Maintains backward compatibility while preparing for PHP 8.5+
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you @iquito. |
|
@fabpot I saw you released a new version, but only |
|
@iquito for patch releases, the splitter creates tags only for subtree repos that have changed since the previous release. That's expected. |
|
@stof The issue is that this PR touched a file from the |
|
It might also be a Packagist issue, I am not sure, but I thought it might be worth it to find out why there is no new release. |
|
@fabpot could you check the github webhook setup ? packagist.org was showing the last update date of twig/twig on November 30th until I clicked the "Update now" button (which made the 3.22.2 tag appear) |
|
Fixed now. |
Change the one usage of
ord()in Twig where a multibyte character can trigger the new deprecation in PHP 8.5, which is in thehtml_attrescape functionality in EscaperRuntime, currently leading to:This small change fixes it. There are no other usages of
ord()in Twig which lead to this deprecation notice.