Plugin Directory

Changeset 2186089


Ignore:
Timestamp:
11/05/2019 11:36:32 AM (6 years ago)
Author:
magblogapi
Message:

3.1.3
Fixes a nasty bug in the "value scrubber" for the shortcode parser.

Location:
nacc-wordpress-plugin/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nacc-wordpress-plugin/trunk/nacc-wordpress-plugin.php

    r2185859 r2186089  
    44Plugin URI: http://magshare.org/nacc
    55Description: This is a WordPress plugin implementation of the N.A. Cleantime Calculator. To use this, specify <!-- NACC --> or [[NACC]] in your text code. That text will be replaced with this cleantime calculator.
    6 Version: 3.1.2
     6Version: 3.1.3
    77Install: Drop this directory in the "wp-content/plugins/" directory and activate it. You need to specify "<!-- NACC -->" or "[[NACC]]" in the code section of a page or a post.
    88*/
     
    2828function nacc_content ( $the_content )
    2929    {
    30     $shortcode_obj = explode(',', get_shortcode ( $the_content ));
    31    
     30    $shortcode_obj = explode(',', html_entity_decode(get_shortcode ( $the_content )));
     31
    3232    if ( $shortcode_obj )
    3333        {
     
    3636        $cc_text .= '<h1 style="text-align:center">JavaScript Required</h1>';
    3737        $cc_text .= '<h2 style="text-align:center">Sadly, you must enable JavaScript on your browser in order to use this cleantime calculator.</h2>';
    38         $siteURI = '"'.esc_url ( plugins_url ( 'nacc2', __FILE__ ) ).'"';
     38        $siteURI = '"'.plugins_url ( 'nacc2', __FILE__ ).'"';
    3939       
    4040        if ( ($shortcode_obj !== true) && (!is_array ( $shortcode_obj )) )
     
    4545        if ( is_array ( $shortcode_obj ) && (count ( $shortcode_obj ) > 0) )
    4646            {
    47             $theme = '"'.trim(strval ( $shortcode_obj[0] ), '"').'"';
     47            $theme = '"'.trim(strval ( $shortcode_obj[0] ), '\'"').'"';
    4848            $lang = '"en"';
    4949            $layout = '"linear"';
     
    5252            if ( count ( $shortcode_obj ) > 1 )
    5353                {
    54                 $lang_temp = strval ( $shortcode_obj[1] );
     54                $lang_temp = '"'.trim(strval ( $shortcode_obj[1] ), '\'"').'"';
    5555               
    5656                if ( $lang_temp )
     
    6262            if ( count ( $shortcode_obj ) > 2 )
    6363                {
    64                 $layout = '"'.strval ( $shortcode_obj[2] ).'"';
     64                $layout = '"'.trim(strval ( $shortcode_obj[2] ), '\'"').'"';
    6565                }
    6666           
    6767            if ( count ( $shortcode_obj ) > 3 )
    6868                {
    69                 $showSpecial = $shortcode_obj[3] ? 'true' : 'false';
     69                $showSpecial = trim(strval ( $shortcode_obj[3] ), '\'"');
    7070                }
     71               
    7172            $cc_text .= '</noscript><script type="text/javascript">var nacc = new NACC("nacc_container", '.$theme.', '.$lang.', '.$layout.', '.$showSpecial.', '.$siteURI.');</script>'."\n";
    7273            }
  • nacc-wordpress-plugin/trunk/readme.txt

    r2185859 r2186089  
    44Requires at least: 2.0
    55Tested up to: 5.2.4
    6 Stable tag: 3.1.2
     6Stable tag: 3.1.3
    77
    88== Description ==
     
    17172. Activate the plugin through the 'Plugins' menu in WordPress
    18183. Place `<!-- NACC -->`in the HTML view, or `[[NACC]]` in either view, of a page. It will be replaced by the plugin.
    19 4. You can change how the plugin appears like so: `<!-- NACC("THEME") -->`, where `THEME` is currently `NACC-BT` (Dark blue and white), or `NACC-GNYR2` (Light blue style customized for the Greater New York Region). Leave it out for default (gray).
    20 5. You can change the language like so: `<!-- NACC("THEME","LANG") -->`, where `LANG` is currently `en` (English -Default), `es` (Spanish), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese), or `it` (Italian).
    21 6. You can specify which layout (vertical or horizontal) you want the tags to appear in by default, like so: `<!-- NACC("THEME","LANG","LAYOUT") -->`, where `LAYOUT` is `linear` (default, in a long line), or `tabular` (In a horizontal row).
    22 7. You can specify whether or not the "special" tags are shown, like so: `<!-- NACC("THEME","LANG","LAYOUT","SPECIAL") -->`, where `SPECIAL` is `true` or `false`.
     194. You can change how the plugin appears like so: `<!-- NACC(`THEME`) -->`, where `THEME` is currently `NACC-BT` (Dark blue and white), `NACC-GNYR2` (Light blue style customized for the Greater New York Region), or "NACC-HOLI" (Black and Red, customized for the Heart of Long Island ASC). Leave it out for default (gray).
     205. You can change the language like so: `<!-- NACC(`THEME`,`LANG`) -->`, where `LANG` is currently `en` (English -Default), `es` (Spanish), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese), or `it` (Italian).
     216. You can specify which layout (vertical or horizontal) you want the tags to appear in by default, like so: `<!-- NACC(`THEME`,`LANG`,`LAYOUT`) -->`, where `LAYOUT` is `linear` (default, in a long line), or `tabular` (In a horizontal row).
     227. You can specify whether or not the "special" tags are shown, like so: `<!-- NACC(`THEME`,`LANG`,`LAYOUT`,`SPECIAL`) -->`, where `SPECIAL` is `true` or `false`.
    2323
    2424== Changelog ==
     25
     26Version 3.1.3- November 5, 2019
     27    Fixed a bug in shortcode setup.
    2528
    2629Version 3.1.2- November 4, 2019
Note: See TracChangeset for help on using the changeset viewer.