From 26679ddafc593e5163df30e98d3ce98b764aa13f Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 27 Aug 2019 23:29:41 +0100 Subject: [PATCH 1/2] Fix: replace curly offset access brace with square brackets As of PHP 7.4: the array and string offset access syntax using curly braces is deprecated. --- src/Helper/Navigation/Sitemap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Helper/Navigation/Sitemap.php b/src/Helper/Navigation/Sitemap.php index 76acb227..08aa922e 100644 --- a/src/Helper/Navigation/Sitemap.php +++ b/src/Helper/Navigation/Sitemap.php @@ -267,10 +267,10 @@ public function url(AbstractPage $page) { $href = $page->getHref(); - if (! isset($href{0})) { + if (! isset($href[0])) { // no href return ''; - } elseif ($href{0} == '/') { + } elseif ($href[0] == '/') { // href is relative to root; use serverUrl helper $url = $this->getServerUrl() . $href; } elseif (preg_match('/^[a-z]+:/im', (string) $href)) { From d3d590044948bbbee0882ca53f72a49b6808bc78 Mon Sep 17 00:00:00 2001 From: webimpress Date: Thu, 10 Oct 2019 22:15:35 +0100 Subject: [PATCH 2/2] Adds CHANGELOG entry for #192 --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32761795..dd9df6af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,9 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#192](https://github.com/zendframework/zend-view/pull/192) changes + curly braces in array and string offset access to square brackets + in order to prevent issues under the upcoming PHP 7.4 release. ## 2.11.2 - 2019-02-19