Bug #14261
closedXHTML cleaning breaks base tag
0%
Description
XHTML Cleaning adds an end tag to the base tag, but the specification forbids this:
http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4
Surprisingly validator.w3.org still validates the page as alright, but perhaps this is a bug/weakness in the validator
(issue imported from #M262)
Updated by Ingmar Schlecht over 20 years ago
So do I get you right that Typo3 in fact produces something like this?
<base href="asdf"></base>
I think that's caused by the $soloTags variable in class t3lib_parsehtml containing only 'br,hr,img,input,area' but not 'base'. So the solution would be to add 'base' to the list of solo tags.
Updated by Simon Child over 20 years ago
xhtml cleaning changed
<base href="http://www.mydomain.com">
to
<base href="http://www.mydomain.com" />
which is invalid according to
http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4
It states "Start tag: required, End tag: forbidden" and their example of valid code is:
<BASE href="http://www.aviary.com/products/intro.html">
and not
<BASE href="http://www.aviary.com/products/intro.html" />
or
<BASE href="http://www.aviary.com/products/intro.html"></base>
Updated by Ingmar Schlecht over 20 years ago
You should disable xhtml_cleaning if you want HTML instead of XHTML.
In XHTML the correct base tag looks like this:
<base href="http://www.mydomain.com" />
In HTML it looks like this:
<base href="http://www.mydomain.com">
So it's no wonder Typo3 corrected this if you enabled XHTML cleaning.