File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
task/updatenotification/src/Extension Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ public function enforceSuffix()
334334 $ origUri = Uri::getInstance ();
335335 $ route = $ origUri ->getPath ();
336336
337- if (substr ($ route , - 9 ) === 'index.php ' || substr ($ route , - 1 ) === '/ ' ) {
337+ if (str_ends_with ($ route , 'index.php ' ) || str_ends_with ($ route , '/ ' ) ) {
338338 // We don't want suffixes when the URL ends in index.php or with a /
339339 return ;
340340 }
@@ -375,7 +375,7 @@ protected function removeIndexphp()
375375 {
376376 $ origUri = Uri::getInstance ();
377377
378- if (substr ($ origUri ->getPath (), - 9 ) === 'index.php ' ) {
378+ if (str_ends_with ($ origUri ->getPath (), 'index.php ' ) ) {
379379 // Remove trailing index.php
380380 $ origUri ->setPath (substr ($ origUri ->getPath (), 0 , -9 ));
381381 $ this ->getApplication ()->redirect ($ origUri ->toString (), 301 );
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ private function sendNotification(ExecuteTaskEvent $event): int
127127 // If we're here, we have updates. First, get a link to the Joomla! Update component.
128128 $ baseURL = Uri::base ();
129129 $ baseURL = rtrim ($ baseURL , '/ ' );
130- $ baseURL .= (substr ($ baseURL , - 13 ) !== 'administrator ' ) ? '/administrator/ ' : '/ ' ;
130+ $ baseURL .= (! str_ends_with ($ baseURL , 'administrator ' ) ) ? '/administrator/ ' : '/ ' ;
131131 $ baseURL .= 'index.php?option=com_joomlaupdate ' ;
132132 $ uri = new Uri ($ baseURL );
133133
You can’t perform that action at this time.
0 commit comments