diff options
author | Faraz Samapoor <f.samapoor@gmail.com> | 2023-06-02 13:13:19 +0330 |
---|---|---|
committer | Faraz Samapoor <f.samapoor@gmail.com> | 2023-06-02 13:13:19 +0330 |
commit | a1ef0285f89112b8777eb47f3c34d07f111660b4 (patch) | |
tree | bd8791fd09d6c18e3859d44382de9ef0f8ead10e /core/Controller/NavigationController.php | |
parent | 09c5f997c6d185d8b23b37a996e7a1130a426d75 (diff) | |
download | nextcloud-server-a1ef0285f89112b8777eb47f3c34d07f111660b4.tar.gz nextcloud-server-a1ef0285f89112b8777eb47f3c34d07f111660b4.zip |
Refactors "strpos" calls in /core to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Diffstat (limited to 'core/Controller/NavigationController.php')
-rw-r--r-- | core/Controller/NavigationController.php | 4 |
1 files changed, 2 insertions, 2 deletions
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']); } } |