ezyang / ezyang/htmlpurifier

rel attribute in anchor tag

Open
#172 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

In some cases the purifier modifies the snippet even though it IS valid registering changes (=errors) in the ErrorCollector.

Example 1:

original snippet: <a href="http://www.google.de" target="_blank" rel="noreferrer noopener">testlink</a>
purified snippet: <a href="http://www.google.de" target="_blank" rel="noreferrer noopener">testlink</a>

In the case above, the purifier logs following errors:

  1. rel attribute on removed
  2. Attributes on transformed from href and target to href, target and rel
  3. Attributes on transformed from href, target and rel to href, target and rel

Example 2:

Besides this, changing the order of values in the rel attribute also returns the same errors:
<a href="http://www.google.de" target="_blank" rel="noopener noreferrer">testlink</a>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing both anchor-tag examples in the purifier and trace how the element and rel attribute are processed by the ErrorCollector. Check why unchanged valid markup, including either rel value order, is reported as modified. Done means these examples remain unchanged and produce no spurious errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.