Plugin Directory

Changeset 2986331


Ignore:
Timestamp:
10/30/2023 05:34:29 PM (2 years ago)
Author:
sevenspark
Message:

Committing 1.4.3 to trunk

Location:
bellows-accordion-menu/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • bellows-accordion-menu/trunk/admin/assets/css/admin.control-panel.css

    r2860904 r2986331  
    9191  text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.2), 1px 0 1px rgba(0, 0, 0, 0.2),
    9292    0 1px 1px rgba(0, 0, 0, 0.2), -1px 0 1px rgba(0, 0, 0, 0.2);
     93}
     94.wp-core-ui .ssmenu-wrap .button-primary:focus,
     95.wp-core-ui .ssmenu-wrap .button-tertiary:focus {
     96  outline: 2px solid #4997ea;
     97  outline-offset: 2px;
    9398}
    9499.wp-core-ui .ssmenu-wrap .button-tertiary {
  • bellows-accordion-menu/trunk/bellows-accordion-menu.php

    r2860904 r2986331  
    55 * Plugin URI:        http://getbellows.com
    66 * Description:       A flexible and robust WordPress accordion menu plugin
    7  * Version:           1.4.2
     7 * Version:           1.4.3
    88 * Requires at least: 5.0
    99 * Requires PHP:      7.4
    1010 * Author:            SevenSpark
    11  * Author URI:        http://sevenspark.com
     11 * Author URI:        https://sevenspark.com
    1212 * Text Domain:       bellows
    1313 * Domain Path:       /languages
     
    1616if( ! defined( 'WPINC' ) ) die;         // If this file is called directly, abort.
    1717
    18 if( ! defined( 'BELLOWS_VERSION' ) )    define( 'BELLOWS_VERSION',  '1.4.2' );
     18if( ! defined( 'BELLOWS_VERSION' ) )    define( 'BELLOWS_VERSION',  '1.4.3' );
    1919if( ! defined( 'BELLOWS_PRO' ) )        define( 'BELLOWS_PRO' ,     false );
    2020
  • bellows-accordion-menu/trunk/includes/bellows.api.php

    r2860904 r2986331  
    33function bellows_menu_toggle( $menu_id, $content, $btn_class, $args ){
    44    $content = apply_filters( 'bellows_menu_toggle_content', $content, $menu_id, $args );
    5     $btn = '<button class="bellows-menu-toggle '.$btn_class.'" aria-controls="'.$menu_id.'">'.$content.'</button>';
     5    $btn = '<button class="bellows-menu-toggle '.esc_attr($btn_class).'" aria-controls="'.esc_attr($menu_id).'">'.$content.'</button>';
    66    return apply_filters( 'bellows_menu_toggle', $btn, $menu_id, $args );
    77}
     
    1616function bellows( $config_id = 'main' , $menu_args = [] ){
    1717
     18    $config_id = bellows_validate_config_id( $config_id );
     19
    1820    _BELLOWS()->set_current_config_id( $config_id );
    1921
    2022    $menu_args['bellows_source'] = 'menu'; // Default source
    2123    $args = bellows_get_nav_menu_args( $config_id , $menu_args );
    22 
    23     // Should the toggle and menu be printed
    24     $print = isset( $args['echo'] ) ? $args['echo'] : true;
    25 
    26     // Get the toggle based on config settings
    27     $toggle = bellows_menu_toggle_default( $args['container_id'], $config_id, $args );
    28 
    29     // If we're printing, print the toggle.
    30     if( $print ){
    31         echo $toggle;
    32     }
     24    $toggle = bellows_output_responsive_toggle($config_id, $args);
    3325
    3426    // Generate the menu (wp_nav_menu will print if we're printing)
     
    4739        'theme_location'    => '',
    4840        'menu'              => '',
    49 
    50 
    5141    ), $atts));
    5242
     43   
    5344    $args = array();
    5445    $args['echo'] = false;
     
    7162 */
    7263function bellows_section( string $config_id, array $menu_args, array $section_args ){
     64
     65    $config_id = bellows_validate_config_id( $config_id );
    7366
    7467    if( !BELLOWS_PRO ){
     
    9386    $args['container_id'] = 'bellows-'.$config_id.'-'.sanitize_key( $menu_args['menu'] ).'-section-'.$section_args['root'];
    9487
    95     // Should the toggle and menu be printed
    96     $print = isset( $args['echo'] ) ? $args['echo'] : true;
    97 
    98     // Get the toggle based on config settings
    99     $toggle = bellows_menu_toggle_default( $args['container_id'], $config_id, $args );
    100 
    101     // If we're printing, print the toggle.
    102     if( $print ){
    103         echo $toggle;
    104     }
     88    // // Should the toggle and menu be printed
     89    // $print = isset( $args['echo'] ) ? $args['echo'] : true;
     90
     91    // // Get the toggle based on config settings
     92    // $toggle = bellows_menu_toggle_default( $args['container_id'], $config_id, $args );
     93
     94    // // If we're printing, print the toggle.
     95    // if( $print ){
     96    //  echo $toggle;
     97    // }
     98
     99    $toggle = bellows_output_responsive_toggle($config_id, $args);
    105100
    106101    // Generate the menu (wp_nav_menu will print if we're printing)
     
    152147        );
    153148    }
     149
     150    $config_id = bellows_validate_config_id( $config_id );
    154151
    155152    // If 'taxonomies' is passed, convert to 'taxonomy'
     
    201198    // bellp( $menu_args );
    202199
     200    $toggle = bellows_output_responsive_toggle($config_id, $menu_args);
     201
    203202    //add_filter( 'wp_get_nav_menu_items' , 'bellows_populate_terms' , 10, 3 );
    204203    add_filter( 'wp_nav_menu_objects' , 'bellows_populate_terms' , 10, 2 );
     
    209208    //TODO: ECHO OR RETURN CHECK
    210209
    211     return $menu;
     210    return $toggle . $menu;
    212211}
    213212
     
    278277        );
    279278    }
     279
     280    $config_id = bellows_validate_config_id( $config_id );
    280281
    281282    $post_arg_defaults = array(
     
    344345    $menu_args = bellows_get_nav_menu_args( $config_id , $menu_args );
    345346
     347    $toggle = bellows_output_responsive_toggle($config_id, $menu_args);
     348
    346349    //bellp( get_term( 73, 'nav_menu' ) );
    347350
     
    357360
    358361    //TODO: ECHO OR RETURN CHECK
    359     return $menu;
     362    return $toggle.$menu;
    360363
    361364}
  • bellows-accordion-menu/trunk/includes/functions.php

    r2860904 r2986331  
    66
    77function bellows_get_nav_menu_args( $config_id , $args = array() ){
     8
     9    // Config ID should be pre-validated
    810
    911    $args['container']          = bellows_op( 'container_tag' , $config_id );
     
    4345    _BELLOWS()->count_menu_instance( $nav_menu_id );
    4446
    45     //ID
     47    //ID (Config ID is pre-validated and pre-escaped)
    4648    $args['container_id']       = 'bellows-'.$config_id.'-'.sanitize_key( $nav_menu_id );
    4749    if( $theme_location ){
     
    6062
    6163    //Config
    62     $args['container_class']    .= ' bellows-'.$config_id;
     64    $args['container_class']    .= ' bellows-'.$config_id; // Already escaped
    6365
    6466    //Source
     
    253255
    254256
     257function bellows_output_responsive_toggle($config_id, $args){
     258    // Should the toggle and menu be printed
     259    $print = isset( $args['echo'] ) ? $args['echo'] : true;
     260
     261    // Get the toggle based on config settings
     262    $toggle = bellows_menu_toggle_default( $args['container_id'], $config_id, $args );
     263
     264    // If we're printing, print the toggle.
     265    if( $print ){
     266        echo $toggle;
     267    }
     268
     269    return $toggle;
     270}
     271
     272
     273/**
     274 * Validates that the passed config ID matches an existing configuration,
     275 * after escaping unsafe characters that may have been passed
     276 *
     277 * If the config is invalid, returns the default configuration
     278 *
     279 */
     280function bellows_validate_config_id( $config_id, $default = 'main' ){
     281
     282    // Escape the string to defend against XSS attacks
     283    $config_id = esc_attr( $config_id );
     284
     285    // If this is the main ID, we don't actually need to query the DB, as this always exists
     286    if( $config_id === 'main' ){
     287        return $config_id;
     288    }
     289
     290    // Find the valid configurations
     291    $valid_configs = bellows_get_menu_configurations();
     292
     293    // If the ID matches a valid configuration, we're good to go
     294    if( in_array( $config_id, $valid_configs ) ){
     295        return $config_id;
     296    }
     297
     298    // If not, return a valid config (main by default)
     299    return $default;
     300}
     301
    255302
    256303function bellp( $d ){
  • bellows-accordion-menu/trunk/languages/bellows.pot

    r2860904 r2986331  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Bellows Pro - Accordion Menu 1.4.2\n"
     5"Project-Id-Version: Bellows Pro - Accordion Menu 1.4.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bellows-pro\n"
    7 "POT-Creation-Date: 2023-02-03 20:49:52+00:00\n"
     7"POT-Creation-Date: 2023-10-30 17:08:51+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    280280msgstr ""
    281281
    282 #: includes/functions.php:93 includes/widget.php:169
     282#: includes/functions.php:95 includes/widget.php:169
    283283#: pro/admin/settings.control-panel.generator.php:346
    284284msgid "Menu"
  • bellows-accordion-menu/trunk/readme.txt

    r2860904 r2986331  
    44Tags: menu, navigation, accordion, images, widgets, icons, shortcodes, responsive, expand, toggle, reveal, accordian
    55Requires at least: 5.0
    6 Tested up to: 6.1.1
     6Tested up to: 6.3.2
    77Requires PHP: 7.4
    8 Stable tag: 1.4.2
     8Stable tag: 1.4.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5757
    5858== Changelog ==
     59
     60= 1.4.3 =
     61
     62* Security: Fix XSS vulnerability - Authenticated (Contributor+) Stored cross-site scripting via shortcode
    5963
    6064= 1.4.2 =
Note: See TracChangeset for help on using the changeset viewer.