From a1ef0285f89112b8777eb47f3c34d07f111660b4 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Fri, 2 Jun 2023 13:13:19 +0330 Subject: Refactors "strpos" calls in /core to improve code readability. Signed-off-by: Faraz Samapoor --- core/Controller/NavigationController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/Controller/NavigationController.php') diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index 6b994ca33f1..a1c3f917fe3 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -94,10 +94,10 @@ class NavigationController extends OCSController { */ private function rewriteToAbsoluteUrls(array $navigation): array { foreach ($navigation as &$entry) { - if (0 !== strpos($entry['href'], $this->urlGenerator->getBaseUrl())) { + if (!str_starts_with($entry['href'], $this->urlGenerator->getBaseUrl())) { $entry['href'] = $this->urlGenerator->getAbsoluteURL($entry['href']); } - if (0 !== strpos($entry['icon'], $this->urlGenerator->getBaseUrl())) { + if (!str_starts_with($entry['icon'], $this->urlGenerator->getBaseUrl())) { $entry['icon'] = $this->urlGenerator->getAbsoluteURL($entry['icon']); } } -- cgit v1.2.3