Plugin Directory

Changeset 2088993

Timestamp:
05/16/2019 09:39:41 AM (5 years ago)
Author:
valendesigns
Message:

Committing 2.7.2 to trunk

Location:
option-tree/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • option-tree/trunk/composer.json

    r2088704 r2088993  
    22  "name": "valendesigns/option-tree",
    33  "description": "Theme Options UI Builder for WordPress.",
    4   "version": "2.7.1",
     4  "version": "2.7.",
    55  "type": "wordpress-plugin",
    66  "homepage": "https://github.com/valendesigns/option-tree",
  • option-tree/trunk/includes/ot-functions-admin.php

    r2088704 r2088993  
    564564            }
    565565        } elseif ( in_array( $type, array( 'css', 'javascript', 'text', 'textarea', 'textarea-simple' ), true ) ) {
    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 );
     566            if ( ! function_exists( '_filter_wp_kses_post' ) ) {
     567                /**
     568                 * Filter the allowed HTML and safe CSS styles.
     569                 *
     570                 * @since 2.7.2
     571                 *
     572                 * @param bool $add Whether to add or remove the filter.
     573                 */
     574                function _filter_wp_kses_post( $add = true ) {
     575                    $css_filter = function ( $attr ) {
     576                        array_push( $attr, 'display', 'visibility' );
     577
     578                        $attr = apply_filters( 'ot_safe_style_css', $attr );
     579
     580                        return $attr;
     581                    };
     582
     583                    $html_filter = function ( $tags, $context ) {
     584                        if ( 'post' === $context ) {
     585                            if ( current_user_can( 'unfiltered_html' ) || true === OT_ALLOW_UNFILTERED_HTML ) {
     586                                $tags['script']   = array_fill_keys( array( 'async', 'charset', 'defer', 'src', 'type' ), true );
     587                                $tags['style']    = array_fill_keys( array( 'media', 'type' ), true );
     588                                $tags['iframe']   = array_fill_keys( array( 'align', 'allowfullscreen', 'class', 'frameborder', 'height', 'id', 'longdesc', 'marginheight', 'marginwidth', 'name', 'sandbox', 'scrolling', 'src', 'srcdoc', 'style', 'width' ), true );
     589                                $tags['noscript'] = true;
     590
     591                                $tags = apply_filters( 'ot_allowed_html', $tags );
     592                            }
     593                        }
     594
     595                        return $tags;
     596                    };
     597
     598                    if ( $add ) {
     599                        add_filter( 'safe_style_css', $css_filter );
     600                        add_filter( 'wp_kses_allowed_html', $html_filter, 10, 2 );
     601                    } else {
     602                        remove_filter( 'safe_style_css', $css_filter );
     603                        remove_filter( 'wp_kses_allowed_html', $html_filter );
    575604                    }
    576605                }
    577                 return $tags;
    578             };
    579 
    580             add_filter( 'wp_kses_allowed_html', $filter, 10, 2 );
     606            }
     607
     608            _filter_wp_kses_post( true );
    581609            $input_safe = wp_kses_post( $input );
    582             remove_filter( 'wp_kses_allowed_html', $filter );
     610            );
    583611        } elseif ( 'date-picker' === $type || 'date-time-picker' === $type ) {
    584612            if ( ! empty( $input ) && (bool) strtotime( $input ) ) {
  • option-tree/trunk/ot-loader.php

    r2088704 r2088993  
    44 * Plugin URI:  https://github.com/valendesigns/option-tree/
    55 * 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
     6 * Version:     2.7.
    77 * Author:      Derek Herman
    88 * Author URI:  http://valendesigns.com
     
    8585             * Current Version number.
    8686             */
    87             define( 'OT_VERSION', '2.7.1' );
     87            define( 'OT_VERSION', '2.7.' );
    8888
    8989            /**
  • option-tree/trunk/readme.txt

    r2088704 r2088993  
    44Requires at least: 3.8
    55Tested up to: 5.2
    6 Stable tag: 2.7.1
     6Stable tag: 2.7.
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    127127== Changelog ==
    128128
     129
     130
     131
    129132= 2.7.1 =
    130133* Hotfix - Fix error cannot redeclare `_sanitize_recursive()`. props @shramee
Note: See TracChangeset for help on using the changeset viewer.