Skip to content

Commit

Permalink
Support noscript for unfiltered_html
Browse files Browse the repository at this point in the history
  • Loading branch information
valendesigns committed May 16, 2019
1 parent 17840a6 commit 2cf1e14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions includes/ot-functions-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,10 @@ function ot_validate_setting( $input, $type, $field_id, $wmpl_id = '' ) {
$filter = function( $tags, $context ) {
if ( 'post' === $context ) {
if ( current_user_can( 'unfiltered_html' ) || true === OT_ALLOW_UNFILTERED_HTML ) {
$tags['script'] = array_fill_keys( array( 'async', 'charset', 'defer', 'src', 'type' ), 1 );
$tags['style'] = array_fill_keys( array( 'media', 'type' ), 1 );
$tags['iframe'] = array_fill_keys( array( 'align', 'frameborder', 'height', 'longdesc', 'marginheight', 'marginwidth', 'name', 'sandbox', 'scrolling', 'src', 'srcdoc', 'width' ), 1 );
$tags['script'] = array_fill_keys( array( 'async', 'charset', 'defer', 'src', 'type' ), 1 );
$tags['style'] = array_fill_keys( array( 'media', 'type' ), 1 );
$tags['iframe'] = array_fill_keys( array( 'align', 'frameborder', 'height', 'longdesc', 'marginheight', 'marginwidth', 'name', 'sandbox', 'scrolling', 'src', 'srcdoc', 'width' ), 1 );
$tags['noscript'] = array();

$tags = apply_filters( 'ot_allowed_html', $tags );
}
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ The most likely scenario is your theme already has OptionTree installed in Theme
## Changelog ##

### 2.7.1 ###
* Hotfix - Fix error cannot redeclare `_sanitize_recursive()`. props @shramee
* Hotfix - Fix error cannot redeclare `_sanitize_recursive()`. props @shramee
* Hotfix - Ensure `noscript` is supported for users with `unfiltered_html` capabilities.

### 2.7.0 ###
* Require PHP 5.3+
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ The most likely scenario is your theme already has OptionTree installed in Theme

= 2.7.1 =
* Hotfix - Fix error cannot redeclare `_sanitize_recursive()`. props @shramee
* Hotfix - Ensure `noscript` is supported for users with `unfiltered_html` capabilities.

= 2.7.0 =
* Require PHP 5.3+
Expand Down

0 comments on commit 2cf1e14

Please sign in to comment.