From 67dd43967389c9bdb98965c80cc69b2879429a8d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 4 Dec 2019 09:49:04 +0100 Subject: [PATCH] vendor/HTMLPurifier: Avoid curly braces to access array offsets https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.array-string-access-curly-brace --- library/vendor/HTMLPurifier/ChildDef/Custom.php | 2 +- library/vendor/HTMLPurifier/Encoder.php | 2 +- library/vendor/HTMLPurifier/TagTransform/Font.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/vendor/HTMLPurifier/ChildDef/Custom.php b/library/vendor/HTMLPurifier/ChildDef/Custom.php index 128132e96..f515888a1 100644 --- a/library/vendor/HTMLPurifier/ChildDef/Custom.php +++ b/library/vendor/HTMLPurifier/ChildDef/Custom.php @@ -45,7 +45,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef protected function _compileRegex() { $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { + if ($raw[0] != '(') { $raw = "($raw)"; } $el = '[#a-zA-Z0-9_.-]+'; diff --git a/library/vendor/HTMLPurifier/Encoder.php b/library/vendor/HTMLPurifier/Encoder.php index b94f17542..40a24266a 100644 --- a/library/vendor/HTMLPurifier/Encoder.php +++ b/library/vendor/HTMLPurifier/Encoder.php @@ -159,7 +159,7 @@ class HTMLPurifier_Encoder $len = strlen($str); for ($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); + $in = ord($str[$i]); $char .= $str[$i]; // append byte to char if (0 == $mState) { // When mState is zero we expect either a US-ASCII character diff --git a/library/vendor/HTMLPurifier/TagTransform/Font.php b/library/vendor/HTMLPurifier/TagTransform/Font.php index 7853d90bc..768c9b153 100644 --- a/library/vendor/HTMLPurifier/TagTransform/Font.php +++ b/library/vendor/HTMLPurifier/TagTransform/Font.php @@ -75,7 +75,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform if (isset($attr['size'])) { // normalize large numbers if ($attr['size'] !== '') { - if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { + if ($attr['size'][0] == '+' || $attr['size'][0] == '-') { $size = (int)$attr['size']; if ($size < -2) { $attr['size'] = '-2';