diff options
author | F. E Noel Nfebe <fenn25.fn@gmail.com> | 2023-06-04 17:11:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-04 17:11:51 +0100 |
commit | cf75c2eaae82b58f5d1bd2cc765b31d5106eeafb (patch) | |
tree | 27770fb65b17fcac11ceab3930f28efd894bfa7e /core/Controller/NavigationController.php | |
parent | 0357e58e3e18aff02611952d23cbb3f7c7aac9b5 (diff) | |
parent | a1ef0285f89112b8777eb47f3c34d07f111660b4 (diff) | |
download | nextcloud-server-cf75c2eaae82b58f5d1bd2cc765b31d5106eeafb.tar.gz nextcloud-server-cf75c2eaae82b58f5d1bd2cc765b31d5106eeafb.zip |
Merge pull request #38602 from fsamapoor/replace_strpos_calls_in_core
Refactors "strpos" calls in /core to improve code readability.
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']); } } |