From d0b20534b94d0295472ab22157a2bc4c2c9fb703 Mon Sep 17 00:00:00 2001 From: Hamid Dehnavi Date: Fri, 7 Jul 2023 04:54:20 +0330 Subject: Refactor "substr" calls to improve code readability Signed-off-by: Hamid Dehnavi --- lib/private/URLGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/URLGenerator.php') diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 3a52b99889c..57bafc3e18d 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -147,7 +147,7 @@ class URLGenerator implements IURLGenerator { $app_path = $this->getAppManager()->getAppPath($appName); // Check if the app is in the app folder if (file_exists($app_path . '/' . $file)) { - if (substr($file, -3) === 'php') { + if (str_ends_with($file, 'php')) { $urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $appName; if ($frontControllerActive) { $urlLinkTo = \OC::$WEBROOT . '/apps/' . $appName; -- cgit v1.2.3