Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Filter removes boolean attributes if they are not last in the attributes order #43644

Open
ryandemmer opened this issue Jun 12, 2024 · 1 comment

Comments

@ryandemmer
Copy link
Contributor

ryandemmer commented Jun 12, 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"

@ryandemmer ryandemmer changed the 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 Jun 12, 2024
@ryandemmer
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants