diff options
author | Robin Appelman <robin@icewind.nl> | 2023-06-01 23:10:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 23:10:00 +0200 |
commit | 9f1d497a0b4dbda86e676a3a55758bc2909cc781 (patch) | |
tree | 968db9431470d4d0e1ea7c80caed373fc9029120 /lib/private/User | |
parent | e81fdfefab6d46b9d326b70c278d52fbb941a431 (diff) | |
parent | fa31c707c0a4c2a72141b8017e66561710185a06 (diff) | |
download | nextcloud-server-9f1d497a0b4dbda86e676a3a55758bc2909cc781.tar.gz nextcloud-server-9f1d497a0b4dbda86e676a3a55758bc2909cc781.zip |
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in lib/private to improve code readability.
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/Session.php | 2 | ||||
-rw-r--r-- | lib/private/User/User.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 6273945ec43..840a3c04373 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -818,7 +818,7 @@ class Session implements IUserSession, Emitter { */ public function tryTokenLogin(IRequest $request) { $authHeader = $request->getHeader('Authorization'); - if (strpos($authHeader, 'Bearer ') === 0) { + if (str_starts_with($authHeader, 'Bearer ')) { $token = substr($authHeader, 7); } else { // No auth header, let's try session id diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 10e9122de84..b7f3b0e3740 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -596,7 +596,7 @@ class User implements IUser { } private function removeProtocolFromUrl(string $url): string { - if (strpos($url, 'https://') === 0) { + if (str_starts_with($url, 'https://')) { return substr($url, strlen('https://')); } |