?
avatar michaelmaass
michaelmaass
26 Jun 2018

joomla-language-override-html-attribute-hyphen-stripped

Steps to reproduce the issue

In the Joomla! backend go to "Extensions > Language(s) > Overrides", and click on "New" to create a new override. Into the field labeled "Language Constant" enter

TEST_CONSTANT

Into the field labeled "Text" enter the following HTML markup code which includes a valid attribute:

<span data-type="abc">A</span>

Click on "Save".

Expected result

<span data-type="abc">A</span>

Actual result

<span datatype="abc">A</span>

Mind: datatype as opposed to the originally entered data-type with a hyphen.

System information (as much as possible)

Joomla! 3.8.8

Additional comments

The hyphen is silently stripped from the attribute name. As far as I can see this is wrong and should be fixed.

I think it is important to mention that the hyphen in a class name — or elsewhere in the text — is not stripped. The following is left untouched when the override is saved:

<span class="my-class">A</span>

Similar for plain text:

Swimming-Pool

Whatever "corrects" the value does not just strip hyphens but seems to make a distinction between HTML attribute names and other strings.

According to the W3C documentation a hyphen in an HTML attribute name is valid:
https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#embedding-custom-non-visible-data-with-the-data-attributes
So a "syntax correction" — if that is what happens here — would not be appropriate.

(As a workaround the text can be entered manually into the *.ini file, of course.)

avatar michaelmaass michaelmaass - open - 26 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Jun 2018
avatar michaelmaass michaelmaass - change - 26 Jun 2018
The description was changed
avatar michaelmaass michaelmaass - edited - 26 Jun 2018
avatar michaelmaass michaelmaass - change - 26 Jun 2018
The description was changed
avatar michaelmaass michaelmaass - edited - 26 Jun 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jun 2018
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 26 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - edited - 26 Jun 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jun 2018
Category com_languages
avatar mbabker
mbabker - comment - 26 Jun 2018

Duplicate of #20579

avatar mbabker mbabker - close - 26 Jun 2018
avatar mbabker mbabker - change - 26 Jun 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-06-26 11:23:09
Closed_By mbabker
avatar michaelmaass
michaelmaass - comment - 26 Jun 2018

@mbabker

So the same "agent" is filtering the input of Joomla articles and removes the hyphen there as well?

If so, my report might be a duplicate. Sorry for that. I searched for issues in the Language department.

avatar mbabker
mbabker - comment - 26 Jun 2018

Yes. The filtering library handles all input filtering and sanitization, regardless of whether you're editing a language override or an article.

avatar michaelmaass
michaelmaass - comment - 26 Jun 2018

But I am logged in as a Super Administrator and the Filter Type is set to "No Filtering" when that happens.

no-filtering

avatar mbabker
mbabker - comment - 26 Jun 2018

That setting applies to how text in WYSIWYG editor fields (such as article editing) is filtered. There are still other code paths that will result in input being filtered and sanitized separate from that setting. In your case, the issue was because of a general bug in the filtering library.

avatar michaelmaass
michaelmaass - comment - 26 Jun 2018

OK, thank you very much for the explanation. :-)

Add a Comment

Login with GitHub to post a comment