mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-02 05:26:43 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user