Avoid ord deprecation in PHP 8.5

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"
This commit is contained in:
Andreas
2025-12-14 11:29:02 +01:00
committed by GitHub
parent 4f323346a3
commit 4d98cce4e4
+1 -1
View File
@@ -272,7 +272,7 @@ final class EscaperRuntime implements RuntimeExtensionInterface
* @license https://framework.zend.com/license/new-bsd New BSD License
*/
$chr = $matches[0];
$ord = \ord($chr);
$ord = \ord($chr[0]);
/*
* The following replaces characters undefined in HTML with the