ezyang / ezyang/htmlpurifier

Element 'button' is not supported (for information on implementing this, see the support forums

Open
#358 1 comment 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

Hi,

I am getting this error while adding button tag in html code. - "Element 'button' is not supported (for information on implementing this, see the support forums"

I want to add button tag like this.
<button type="button" onclick="alert('Hello world!')">Click Me!</button>

Here is my config.

'HTML_Allowed' => 'div,b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src],iframe[src|width|height|class|frameborder],blockquote, *[style|class],button[type]',
'CSS_AllowedProperties' => 'font,
font-size,
font-weight,
font-style,
font-family,
text-decoration,
padding-left,
color,
background-color,
text-align
',
'URI_SafeIframeRegexp' => '%^(https?:)?//(www.linkedin.com/embed/|www.youtube.com/embed/|player.vimeo.com/video/)%'

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 reviewing how the HTML_Allowed configuration handles the unsupported button element and compare it with the supplied button example. Determine the intended sanitized output and security implications, then verify behavior with the project's existing validation tests; the issue names no files or tests, so the relevant entry point must first be located.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.