? ? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
31 May 2019

Pull Request for Issue #9010.

Summary of Changes

This removes the base tag from the frontend. The idea of the base tag is to define a base for relative URLs. Consider you have the site http://www.example.com/this/is/index.php/with/more/content and all requests should go to the folder http://www.example.com/this/is/, you would set the base tag to exactly that URL. However, we are setting that base tag always to the current URL, which simply is wrong. Even worse, we aren't doing it correctly, because we are forgetting the query part. So we are not setting it to a special path, but are just using the current URL. Now guess what the default value is, when that base tag is NOT set at all. The answer is not "42", but: The current URL.

A quick check shows that neither Wordpress nor Drupal or Typo3 seem to have a base tag in their default output. We are just oh-so-special... Sorry...

Testing Instructions

Apply this change and then check if everything on your site still works as expected.

This would be a fix for an issue that is over 3 years old and that has been discussed several times in the Joomla project... Would be nice to finally solve that.

avatar Hackwar Hackwar - open - 31 May 2019
avatar Hackwar Hackwar - change - 31 May 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 May 2019
Category Libraries
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Jun 2019
avatar brianteeman
brianteeman - comment - 1 Jun 2019

Does this need to be removed as well?

// Generate base tag (need to happen early)
$base = $this->_doc->getBase();
if (!empty($base))
{
$buffer .= $tab . '<base href="' . $base . '">' . $lnEnd;
}

avatar Hackwar
Hackwar - comment - 1 Jun 2019

@brianteeman I thought about this. I opted for keeping that feature generally available to whoever wants to use it, but just to not use it in the SiteApplication. That makes the (small) B/C break smaller.

avatar Hackwar Hackwar - change - 1 Jun 2019
Title
[4.0] Removing <base> tag from frontend
[4.0] Removing tag from frontend
Labels Added: ?
avatar Hackwar Hackwar - change - 1 Jun 2019
Title
[4.0] Removing tag from frontend
[4.0] Removing base tag from frontend
avatar Hackwar Hackwar - edited - 1 Jun 2019
avatar Hackwar Hackwar - change - 2 Jun 2019
The description was changed
avatar Hackwar Hackwar - edited - 2 Jun 2019
avatar SharkyKZ
SharkyKZ - comment - 14 Jun 2019

I have tested this item successfully on 7d9b0b3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25077.

avatar SharkyKZ SharkyKZ - test_item - 14 Jun 2019 - Tested successfully
avatar Quy
Quy - comment - 14 Jun 2019

I have tested this item successfully on 7d9b0b3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25077.

avatar Quy Quy - test_item - 14 Jun 2019 - Tested successfully
avatar Quy Quy - change - 14 Jun 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 14 Jun 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25077.

avatar roland-d roland-d - close - 15 Jun 2019
avatar roland-d roland-d - merge - 15 Jun 2019
avatar roland-d roland-d - change - 15 Jun 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-15 20:47:28
Closed_By roland-d
Labels Added: ?
avatar roland-d
roland-d - comment - 15 Jun 2019

Thank you

avatar HLeithner
HLeithner - comment - 16 Jun 2019

This needs to be documented in the migration guide.

avatar brianteeman
brianteeman - comment - 16 Jun 2019

@HLeithner please add the documentation required label

avatar HLeithner
HLeithner - comment - 16 Jun 2019

thx franz

Add a Comment

Login with GitHub to post a comment