Skip to content

Commit

Permalink
Add support for <a download> to HTML Purifier
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Oct 26, 2018
1 parent e9fa80a commit b4cb16c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Added
- Email and URL fields now have “Placeholder Text” settings. ([#3397](https://github.com/craftcms/cms/issues/3397))

### Changed
- The default HTML Purifier configuration now allows `download` attributes in `<a>` tags. ([craftcms/redactor#86](https://github.com/craftcms/redactor/issues/86))

### Fixed
- Fixed a bug where the `ContentBehaviour` and `ElementQueryBehavior` classes could be missing some field properties. ([#3400](https://github.com/craftcms/cms/issues/3400))
- Fixed a bug where some fields within Matrix fields could lose their values after enabling the “Manage blocks on a per-site basis” setting. ([verbb/super-table/203](https://github.com/verbb/super-table/issues/203))
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/HtmlPurifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public static function configure($config)
// http://developers.whatwg.org/edits.html
$def->addElement('ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']);
$def->addElement('del', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']);

// https://github.com/ezyang/htmlpurifier/issues/152#issuecomment-414192516
$def->addAttribute('a', 'download', 'URI');
}
}
}

0 comments on commit b4cb16c

Please sign in to comment.