No Code Attached Yet
avatar ryandemmer
ryandemmer
12 Jun 2024

Steps to reproduce the issue

Assuming you are logged in as a Super User:

  1. In the Global Configuration, set the Default Editor to "Editor - None"
  2. In the Global Configuration, click on the Text Filter tab and set the Filter Type for the Super User group to Default Forbidden List.
  3. Create a new Article with any Title eg: Video test.
  4. Paste the following code into the textarea. The src value is irrelevant:
<video src="images/big_buck_bunny_trailer_480p.mp4" autoplay controls width="854" height="315"></video>
  1. Click Save.

Expected result

Boolean attributes autoplay and controls are retained.

Actual result

Boolean attributes autoplay and controls are removed.

System information (as much as possible)

Joomla 4.4.x amd Joomla 5.x
PHP 8.x

Additional comments

If the boolean attributes are set as the last attributes, then they are retained, eg:

<video src="images/big_buck_bunny_trailer_480p.mp4" width="854" height="315" autoplay controls></video>

The boolean attributes are still removed if they have empty values, eg: controls=""
The boolean attributes are not removed if they have non-empty values, eg: controls="controls"

avatar ryandemmer ryandemmer - open - 12 Jun 2024
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jun 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Jun 2024
avatar ryandemmer ryandemmer - change - 12 Jun 2024
The description was changed
avatar ryandemmer ryandemmer - edited - 12 Jun 2024
avatar ryandemmer ryandemmer - change - 12 Jun 2024
The description was changed
avatar ryandemmer ryandemmer - edited - 12 Jun 2024
avatar ryandemmer ryandemmer - change - 12 Jun 2024
Title
Text Filter removes boolean attributes if they are not the last in the attributes order
Text Filter removes boolean attributes if they are not last in the attributes order
avatar ryandemmer ryandemmer - edited - 12 Jun 2024
avatar ryandemmer
ryandemmer - comment - 28 Jun 2024

Is there any paraticular reason why we might not use DOMDocument to extract and process tags and attributes? Performance?

avatar Hackwar
Hackwar - comment - 5 Aug 2024

The filtering is done by the framework filter package. The problem most likely is in InputFilter::remove(). At least for now, it would have to be fixed there. @ryandemmer would you be willing to work on this and create a PR against the 2.x-dev branch? https://github.com/joomla-framework/filter
Please also extend the tests to check for this situation, so that we are sure this is covered.

avatar ryandemmer
ryandemmer - comment - 5 Aug 2024

@ryandemmer would you be willing to work on this and create a PR against the 2.x-dev branch? https://github.com/joomla-framework/filter

I'll certainly give it my best shot :)

Add a Comment

Login with GitHub to post a comment