diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2020-07-03 12:13:20 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2020-07-04 09:51:06 +0100 |
| commit | dec352c1d7404cdd35c9b1a1b5d97f29e7c4ebb5 (patch) | |
| tree | 2383561d35c33f954a176d9ed00f391dc7e0303f /app/Http/RequestHandlers/ModuleAction.php | |
| parent | 6f68916103931ce3f715eba5c6f55acf120c084e (diff) | |
| download | webtrees-dec352c1d7404cdd35c9b1a1b5d97f29e7c4ebb5.tar.gz webtrees-dec352c1d7404cdd35c9b1a1b5d97f29e7c4ebb5.tar.bz2 webtrees-dec352c1d7404cdd35c9b1a1b5d97f29e7c4ebb5.zip | |
Use new PHP functions - str_starts_with(), str_ends_with() and str_contains()
Diffstat (limited to 'app/Http/RequestHandlers/ModuleAction.php')
| -rw-r--r-- | app/Http/RequestHandlers/ModuleAction.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/Http/RequestHandlers/ModuleAction.php b/app/Http/RequestHandlers/ModuleAction.php index 94613065aa..29d39f2521 100644 --- a/app/Http/RequestHandlers/ModuleAction.php +++ b/app/Http/RequestHandlers/ModuleAction.php @@ -2,7 +2,7 @@ /** * webtrees: online genealogy - * Copyright (C) 2019 webtrees development team + * Copyright (C) 2020 webtrees development team * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -30,7 +30,7 @@ use Psr\Http\Server\RequestHandlerInterface; use function call_user_func; use function method_exists; -use function strpos; +use function str_contains; use function strtolower; /** @@ -79,7 +79,7 @@ class ModuleAction implements RequestHandlerInterface $method = $verb . $action . 'Action'; // Actions with "Admin" in the name are for administrators only. - if (strpos($action, 'Admin') !== false && !Auth::isAdmin($user)) { + if (str_contains($action, 'Admin') && !Auth::isAdmin($user)) { throw new HttpAccessDeniedException('Admin only action'); } |
