diff --git a/plugins/system/sef/src/Extension/Sef.php b/plugins/system/sef/src/Extension/Sef.php index 21b04587f57ea..abe9f1ae99f79 100644 --- a/plugins/system/sef/src/Extension/Sef.php +++ b/plugins/system/sef/src/Extension/Sef.php @@ -334,7 +334,7 @@ public function enforceSuffix() $origUri = Uri::getInstance(); $route = $origUri->getPath(); - if (substr($route, -9) === 'index.php' || substr($route, -1) === '/') { + if (str_ends_with($route, 'index.php') || str_ends_with($route, '/')) { // We don't want suffixes when the URL ends in index.php or with a / return; } @@ -375,7 +375,7 @@ protected function removeIndexphp() { $origUri = Uri::getInstance(); - if (substr($origUri->getPath(), -9) === 'index.php') { + if (str_ends_with($origUri->getPath(), 'index.php')) { // Remove trailing index.php $origUri->setPath(substr($origUri->getPath(), 0, -9)); $this->getApplication()->redirect($origUri->toString(), 301); diff --git a/plugins/task/updatenotification/src/Extension/UpdateNotification.php b/plugins/task/updatenotification/src/Extension/UpdateNotification.php index e845b4840676d..7ad5464b0c54e 100644 --- a/plugins/task/updatenotification/src/Extension/UpdateNotification.php +++ b/plugins/task/updatenotification/src/Extension/UpdateNotification.php @@ -127,7 +127,7 @@ private function sendNotification(ExecuteTaskEvent $event): int // If we're here, we have updates. First, get a link to the Joomla! Update component. $baseURL = Uri::base(); $baseURL = rtrim($baseURL, '/'); - $baseURL .= (substr($baseURL, -13) !== 'administrator') ? '/administrator/' : '/'; + $baseURL .= (!str_ends_with($baseURL, 'administrator')) ? '/administrator/' : '/'; $baseURL .= 'index.php?option=com_joomlaupdate'; $uri = new Uri($baseURL);