From aa37ab57e685a209a06b0d7b79fa686f2a1ae792 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 31 Jan 2020 14:28:54 +0000 Subject: [PATCH] stop using { } for string character access (use [ ] instead) - see https://www.php.net/manual/en/language.types.string.php#language.types.string.substr --- functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index cb29f23d..af96537c 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -739,7 +739,7 @@ function encode_header($string, $default_charset = "utf-8") { $ret = ''; $iEncStart = false; } else { - $ret .= sprintf("=%02X", ord($string{$i})); + $ret .= sprintf("=%02X", ord($string[$i])); } break; case '(': @@ -769,7 +769,7 @@ function encode_header($string, $default_charset = "utf-8") { } break; default: - $k = ord($string{$i}); + $k = ord($string[$i]); if ($k > 126) { if ($iEncStart === false) { // do not start encoding in the middle of a string, also take the rest of the word.