Version Description
- Hotfix - Fix error cannot redeclare
_sanitize_recursive()
. props @shramee - Hotfix - Ensure
iframe
supports thestyle
attribute for users withunfiltered_html
capabilities. - Hotfix - Ensure
noscript
is supported for users withunfiltered_html
capabilities.
Download this release
Release Info
Developer | valendesigns |
Plugin | OptionTree |
Version | 2.7.1 |
Comparing to | |
See all releases |
Code changes from version 2.7.0 to 2.7.1
- composer.json +1 -0
- includes/ot-functions-admin.php +23 -22
- ot-loader.php +2 -2
- readme.txt +7 -2
composer.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
{
|
2 |
"name": "valendesigns/option-tree",
|
3 |
"description": "Theme Options UI Builder for WordPress.",
|
|
|
4 |
"type": "wordpress-plugin",
|
5 |
"homepage": "https://github.com/valendesigns/option-tree",
|
6 |
"license": "GPL-2.0-or-later",
|
1 |
{
|
2 |
"name": "valendesigns/option-tree",
|
3 |
"description": "Theme Options UI Builder for WordPress.",
|
4 |
+
"version": "2.7.1",
|
5 |
"type": "wordpress-plugin",
|
6 |
"homepage": "https://github.com/valendesigns/option-tree",
|
7 |
"license": "GPL-2.0-or-later",
|
includes/ot-functions-admin.php
CHANGED
@@ -566,9 +566,10 @@ if ( ! function_exists( 'ot_validate_setting' ) ) {
|
|
566 |
$filter = function( $tags, $context ) {
|
567 |
if ( 'post' === $context ) {
|
568 |
if ( current_user_can( 'unfiltered_html' ) || true === OT_ALLOW_UNFILTERED_HTML ) {
|
569 |
-
$tags['script']
|
570 |
-
$tags['style']
|
571 |
-
$tags['iframe']
|
|
|
572 |
|
573 |
$tags = apply_filters( 'ot_allowed_html', $tags );
|
574 |
}
|
@@ -731,29 +732,29 @@ if ( ! function_exists( 'ot_validate_setting' ) ) {
|
|
731 |
if ( is_scalar( $input ) ) {
|
732 |
$input_safe = sanitize_textarea_field( $input );
|
733 |
} else {
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
|
|
750 |
}
|
751 |
}
|
752 |
-
}
|
753 |
|
754 |
-
|
|
|
755 |
}
|
756 |
-
|
757 |
$input_safe = _sanitize_recursive( $input );
|
758 |
}
|
759 |
}
|
566 |
$filter = function( $tags, $context ) {
|
567 |
if ( 'post' === $context ) {
|
568 |
if ( current_user_can( 'unfiltered_html' ) || true === OT_ALLOW_UNFILTERED_HTML ) {
|
569 |
+
$tags['script'] = array_fill_keys( array( 'async', 'charset', 'defer', 'src', 'type' ), 1 );
|
570 |
+
$tags['style'] = array_fill_keys( array( 'media', 'type' ), 1 );
|
571 |
+
$tags['iframe'] = array_fill_keys( array( 'align', 'frameborder', 'height', 'longdesc', 'marginheight', 'marginwidth', 'name', 'sandbox', 'scrolling', 'src', 'srcdoc', 'style', 'width' ), 1 );
|
572 |
+
$tags['noscript'] = array();
|
573 |
|
574 |
$tags = apply_filters( 'ot_allowed_html', $tags );
|
575 |
}
|
732 |
if ( is_scalar( $input ) ) {
|
733 |
$input_safe = sanitize_textarea_field( $input );
|
734 |
} else {
|
735 |
+
if ( ! function_exists( '_sanitize_recursive' ) ) {
|
736 |
+
/**
|
737 |
+
* Filter the array values recursively.
|
738 |
+
*
|
739 |
+
* @param array $values The value to sanitize.
|
740 |
+
*
|
741 |
+
* @return array
|
742 |
+
*/
|
743 |
+
function _sanitize_recursive( $values = array() ) {
|
744 |
+
$result = array();
|
745 |
+
foreach ( $values as $key => $value ) {
|
746 |
+
if ( ! is_object( $value ) ) {
|
747 |
+
if ( is_scalar( $value ) ) {
|
748 |
+
$result[ $key ] = sanitize_textarea_field( $value );
|
749 |
+
} else {
|
750 |
+
$result[ $key ] = _sanitize_recursive( $value );
|
751 |
+
}
|
752 |
}
|
753 |
}
|
|
|
754 |
|
755 |
+
return $result;
|
756 |
+
}
|
757 |
}
|
|
|
758 |
$input_safe = _sanitize_recursive( $input );
|
759 |
}
|
760 |
}
|
ot-loader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: OptionTree
|
4 |
* Plugin URI: https://github.com/valendesigns/option-tree/
|
5 |
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
6 |
-
* Version: 2.7.
|
7 |
* Author: Derek Herman
|
8 |
* Author URI: http://valendesigns.com
|
9 |
* License: GPLv2 or later
|
@@ -84,7 +84,7 @@ if ( ! class_exists( 'OT_Loader' ) && defined( 'ABSPATH' ) ) {
|
|
84 |
/**
|
85 |
* Current Version number.
|
86 |
*/
|
87 |
-
define( 'OT_VERSION', '2.7.
|
88 |
|
89 |
/**
|
90 |
* For developers: Theme mode.
|
3 |
* Plugin Name: OptionTree
|
4 |
* Plugin URI: https://github.com/valendesigns/option-tree/
|
5 |
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
6 |
+
* Version: 2.7.1
|
7 |
* Author: Derek Herman
|
8 |
* Author URI: http://valendesigns.com
|
9 |
* License: GPLv2 or later
|
84 |
/**
|
85 |
* Current Version number.
|
86 |
*/
|
87 |
+
define( 'OT_VERSION', '2.7.1' );
|
88 |
|
89 |
/**
|
90 |
* For developers: Theme mode.
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: valendesigns
|
3 |
Tags: options, theme options, meta boxes, settings
|
4 |
Requires at least: 3.8
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 2.7.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Donate link: https://bit.ly/2TBvksV
|
@@ -126,6 +126,11 @@ The most likely scenario is your theme already has OptionTree installed in Theme
|
|
126 |
|
127 |
== Changelog ==
|
128 |
|
|
|
|
|
|
|
|
|
|
|
129 |
= 2.7.0 =
|
130 |
* Require PHP 5.3+
|
131 |
* Fix all PHPCS errors and warnings.
|
2 |
Contributors: valendesigns
|
3 |
Tags: options, theme options, meta boxes, settings
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 5.2
|
6 |
+
Stable tag: 2.7.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Donate link: https://bit.ly/2TBvksV
|
126 |
|
127 |
== Changelog ==
|
128 |
|
129 |
+
= 2.7.1 =
|
130 |
+
* Hotfix - Fix error cannot redeclare `_sanitize_recursive()`. props @shramee
|
131 |
+
* Hotfix - Ensure `iframe` supports the `style` attribute for users with `unfiltered_html` capabilities.
|
132 |
+
* Hotfix - Ensure `noscript` is supported for users with `unfiltered_html` capabilities.
|
133 |
+
|
134 |
= 2.7.0 =
|
135 |
* Require PHP 5.3+
|
136 |
* Fix all PHPCS errors and warnings.
|