Merge pull request #39217 from shdehnavi/replace_substr_call_in_lib_public

This commit is contained in:
John Molakvoæ 2024-08-06 09:35:11 +02:00 committed by GitHub
commit ead047153a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -189,7 +189,7 @@ abstract class AuthPublicShareController extends PublicShareController {
private function getRoute(string $function): string {
$app = strtolower($this->appName);
$class = (new \ReflectionClass($this))->getShortName();
if (substr($class, -10) === 'Controller') {
if (str_ends_with($class, 'Controller')) {
$class = substr($class, 0, -10);
}
return $app .'.'. $class .'.'. $function;