From 59ba5bec5761b87f50488fd12021b07988d0c8ee Mon Sep 17 00:00:00 2001 From: Daniel Zabel Date: Sun, 31 Oct 2021 16:53:34 +0100 Subject: [PATCH] php 7.4 compatibility - fixes "Array and string offset access syntax with curly braces is deprecated" --- Classes/Configuration/ConfigurationReader.php | 2 +- Classes/Encoder/UrlEncoder.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Configuration/ConfigurationReader.php b/Classes/Configuration/ConfigurationReader.php index 2c08695f..f15b03cd 100644 --- a/Classes/Configuration/ConfigurationReader.php +++ b/Classes/Configuration/ConfigurationReader.php @@ -234,7 +234,7 @@ protected function getConfigurationKeyByDomainDecode($configurationKey) { $globalConfig = &$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']; foreach ($globalConfig['_DOMAINS']['decode'] as $domainName => $configuration) { $checkThisConfiguration = false; - if ($domainName{0} == '/') { + if ($domainName[0] == '/') { // Regular expression, match only main host name if (@preg_match($domainName, $this->hostName)) { $checkThisConfiguration = true; diff --git a/Classes/Encoder/UrlEncoder.php b/Classes/Encoder/UrlEncoder.php index 953d7c3f..5a8955a2 100644 --- a/Classes/Encoder/UrlEncoder.php +++ b/Classes/Encoder/UrlEncoder.php @@ -162,10 +162,10 @@ public function postProcessEncodedUrl(array &$parameters, ContentObjectRenderer if (preg_match('/^https?:\/\/[^\/]+\//', $url)) { $url = preg_replace('/^https?:\/\/[^\/]+(\/.*)$/', '\1', $url); } - if (self::$urlPrepend{strlen(self::$urlPrepend) - 1} === '/' && $url && $url{0} === '/') { + if (self::$urlPrepend[strlen(self::$urlPrepend) - 1] === '/' && $url && $url[0] === '/') { $url = substr($url, 1); } - if (self::$urlPrepend{strlen(self::$urlPrepend) - 1} !== '/' && ($url === '' || $url{0} !== '/')) { + if (self::$urlPrepend[strlen(self::$urlPrepend) - 1] !== '/' && ($url === '' || $url[0] !== '/')) { $url = '/' . $url; } $url = self::$urlPrepend . $url; @@ -1211,7 +1211,7 @@ protected function handleFileNameUsingGetVars() { if ($useThisConfiguration) { - if ($fileName{0} === '.') { + if ($fileName[0] === '.') { if ($this->encodedUrl === '') { $this->encodedUrl = 'index'; }