Update Url.php

Update to PHP 7.4+
This commit is contained in:
Florin-Ciprian Bodin
2023-10-25 18:02:12 +03:00
committed by GitHub
parent f887c91271
commit 340af8341d

View File

@@ -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
}
}
?>
?>