No Code Attached Yet bug
avatar joeforjoomla
joeforjoomla
20 Aug 2025

Steps to reproduce the issue

SEF Plugin with 'Strict routing' OFF

Open a URL like http://joomla60dev/index.php?option=com_mycomponent&view=myview&lang=en

Expected result

URL stays the same

Actual result

URL gets redirected to its SEF version

So there is a discrepancy between the parameter and the actual behavior

avatar joeforjoomla joeforjoomla - open - 20 Aug 2025
avatar joomla-cms-bot joomla-cms-bot - change - 20 Aug 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Aug 2025
avatar brianteeman
brianteeman - comment - 20 Aug 2025

Strict routing off does not mean SEF off

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

@brianteeman of course, but there should not be SEF redirecting from non-SEF to SEF version of a URL

avatar brianteeman
brianteeman - comment - 20 Aug 2025

of course there should. that is how joomla has always worked. Ever since 1.0

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

@brianteeman maybe i didn't express myself correctly.

What i mean is that if you open:

http://joomla50dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL stays the same, no redirect

if you open:

http://joomla60dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL does not stay the same, redirects to

http://joomla60dev/component/mycomponent/?view=myview

Never worked in this way, So it looks no longer possible to access a raw URL without a redirect using the GET method.

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

@brianteeman maybe i didn't express myself correctly.

What i mean is that if you open:

http://joomla50dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL stays the same, no redirect

if you open:

http://joomla60dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL does not stay the same, redirects to

http://joomla60dev/component/mycomponent/?view=myview

Never worked in this way,

avatar brianteeman
brianteeman - comment - 20 Aug 2025

Just for testing what happens when you don't add the lang= param

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

Without lang = param then it works as supposed, the URL keeps to stay original like:

http://joomla60dev/index.php?option=com_mycomponent&view=myview

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

It's all related to #43858 in my opinion

avatar brianteeman
brianteeman - comment - 20 Aug 2025

I asked because there was possibly a similar issue reported on 5.3 and that was the language param on a non multilingual site

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

Understood, but this is something new that should be addressed by @Hackwar

avatar Fedik
Fedik - comment - 20 Aug 2025

The redirect happen at this point

/**
* The URL was successfully parsed, but is "tainted", e.g. parts of
* it were recoverably wrong. So we take the parsed variables, build
* a new URL and redirect to that.
*/
if ($router->isTainted()) {

I did not debugged deeper.

avatar Fedik
Fedik - comment - 20 Aug 2025

I cannot say is it bug or feature.
When I disable SEF then I get no redirect, so kind of nothing wrong.

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

@Fedik given that it's an important behavior change that could lead to several broken extensions... it's a big problem that should be considered as a bug. Most importantly because the presence of 'lang=xx' makes the difference.

avatar brianteeman
brianteeman - comment - 20 Aug 2025

To be clear. You are setting lang param on a non multilingual site?

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

@brianteeman i'm setting the lang param on a multilingual site

avatar brianteeman
brianteeman - comment - 20 Aug 2025

ok - thanks for clarifying that - its a different issue then to the one I mentioned earlier

avatar Hackwar
Hackwar - comment - 20 Aug 2025

This has nothing to do with the lang parameter. This is a new feature to redirect URLs which we were able to parse correctly, but which are not the "canonical" SEF URL to the correct URL. It only happens for GET requests and you can of course still access raw URLs. You are just being redirected to the correct version of the URL then.

avatar joeforjoomla
joeforjoomla - comment - 20 Aug 2025

@brianteeman You're welcome, and thank you.

@Hackwar In that case, the situation is even more concerning. This new feature cannot be enabled by default. At the very least, there should be a setting for it, similar to the 'Strict routing' option in the SEF plugin.

Consider a component like Joomshaper SPPB, which uses an iframe for its editor. A GET request for that iframe (e.g., http://joomla60dev/index.php?option=com_sppagebuilder&view=form&id=23&layout=edit-iframe&Itemid=0&lang=de) would be processed into a canonical SEF URL. This redirection could cause issues, as the raw URL may not function identically after the redirect, potentially breaking functionality in many cases.

avatar Fedik
Fedik - comment - 21 Aug 2025

@Hackwar I think the issue is here

} else {
// No language is set, so we want to redirect to the right language
$router->setTainted();
}
// The language was set both per SEF path and per query parameter. Query parameter takes precedence
if ($lang) {
$uri->setVar('lang', $lang);
$router->setTainted();

The missing check for $lang form Uri.
When change the code to:

} elseif (!isset($this->sefs[$lang])) {
  // No language is set, so we want to redirect to the right language
  $router->setTainted();
}

// The language was set both per SEF path and per query parameter. Query parameter takes precedence
if ($lang && isset($this->sefs[$sef])) {
  $uri->setVar('lang', $lang);
  $router->setTainted();
}

Then all seems works.
But maybe there a better way, or i missed something still.

avatar Fedik Fedik - change - 23 Aug 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-08-23 08:17:08
Closed_By Fedik
avatar Fedik Fedik - close - 23 Aug 2025
avatar Fedik
Fedik - comment - 23 Aug 2025

I added the fix in to #45947
Because it need that fix also.

Please test

avatar Fedik Fedik - change - 23 Aug 2025
Labels Added: bug
avatar Fedik Fedik - labeled - 23 Aug 2025

Add a Comment

Login with GitHub to post a comment