? Pending

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
9 Oct 2018

Pull Request for Issue #22527

Summary of Changes

Set the correct URL address of the base of website.
This will be the equivalent of JUri::base().

The <base> tag should point to the real path, not to the SEF virtual path.
The <base> tag can be useful for creating shortened relative links to images, css or scripts.

Testing Instructions

See at #22527

avatar csthomas csthomas - open - 9 Oct 2018
avatar csthomas csthomas - change - 9 Oct 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2018
Category Libraries
avatar SharkyKZ
SharkyKZ - comment - 9 Oct 2018

This breaks anchors.

avatar csthomas
csthomas - comment - 9 Oct 2018

If the URL has a query, like ...?start=2 or ...?page=2 then the anchor was broken even before. See #9010

avatar SharkyKZ
SharkyKZ - comment - 9 Oct 2018

It's because JUri::current() doesn't return query string. But the idea of using current URL is correct. This is the default behavior when no base tag is specified. So it should be JUri::getInstance(). Ultimately, base tag could be removed completely.

avatar csthomas
csthomas - comment - 10 Oct 2018

AFAIK <base> tag can not have query string.

I don't know the reason of adding the base tag to joomla.
If it was not for security reasons, I would like to remove it at all.

This PR probably will be treated as break B/C.

For everybody who does not like this tag, you can add a simple line of code to remove this tag from your template.

Add the following line somewhere at the top of your template index.php file:

JFactory::getDocument()->setBase('');
avatar SharkyKZ
SharkyKZ - comment - 10 Oct 2018

AFAIK tag can not have query string.

It can be any valid URL. See https://www.w3.org/TR/html50/document-metadata#the-base-element.

avatar csthomas
csthomas - comment - 10 Oct 2018

I have read https://stackoverflow.com/questions/1889076/what-are-the-recommendations-for-html-base-tag

If we do as you say @SharkyKZ then <base> tag will be redundant because the same effect you can get by removing this tag from html at all.

avatar SharkyKZ
SharkyKZ - comment - 10 Oct 2018

That's the idea.

avatar csthomas
csthomas - comment - 10 Oct 2018

Would it be better to remove <base> tag?

avatar csthomas
csthomas - comment - 10 Oct 2018

The base tag probably should not be the same as URL, take a look at https://audisto.com/help/crawler/features/hints/group/21#h84

avatar csthomas
csthomas - comment - 10 Oct 2018

I created a second PR, which remove the base tag. I leave the choice to testers and maintainers.

avatar SharkyKZ
SharkyKZ - comment - 11 Oct 2018

The base tag probably should not be the same as URL, take a look at https://audisto.com/help/crawler/features/hints/group/21#h84

It's only saying that the tag is redundant when it points to current URL. Which isn't true considering srcdoc usage. Probably not important in our case, just something to keep in mind.

avatar csthomas
csthomas - comment - 11 Oct 2018

If it will be redundant, will we need it?
If you still want to add the query then please create your own PR.
I would prefer to remove <base> tag as I did in #22571

avatar csthomas
csthomas - comment - 17 Oct 2018

After conversation at #22571 this PR can not go to joomla 3.

avatar csthomas csthomas - change - 17 Oct 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-10-17 21:05:54
Closed_By csthomas
Labels Added: ?
avatar csthomas csthomas - close - 17 Oct 2018

Add a Comment

Login with GitHub to post a comment