From 340af8341d75abb7bc3fa427add7256b944bf436 Mon Sep 17 00:00:00 2001 From: Florin-Ciprian Bodin Date: Wed, 25 Oct 2023 18:02:12 +0300 Subject: [PATCH] Update Url.php Update to PHP 7.4+ --- classes/Url.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/Url.php b/classes/Url.php index 5f23a9d..09527b0 100644 --- a/classes/Url.php +++ b/classes/Url.php @@ -99,7 +99,7 @@ class Url { return ''; } - if ($d{0} == '/' && $new_dir{0} != '/') + if ($d[0] == '/' && $new_dir[0] != '/') { $new_dir = '/' . $new_dir; } @@ -108,9 +108,8 @@ class Url $new_dir .= '/'; } else if (DirectoryList::is_hidden(Item::get_basename($new_dir))) - //it's a file, so make sure the file itself is not hidden { - return DirItem::get_parent_dir($new_dir); + return DirItem::get_parent_dir($new_dir); //it's a file, so make sure the file itself is not hidden } return $new_dir; } @@ -226,4 +225,4 @@ class Url } } -?> \ No newline at end of file +?>