Plugin Directory

Changeset 2044373


Ignore:
Timestamp:
03/05/2019 07:59:30 AM (7 years ago)
Author:
SriniG
Message:

v2.5.1: Fix for an issue where the widget output breaks html loop in some cases

Location:
quotes-collection/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • quotes-collection/trunk/inc/class-quotes-collection.php

    r2037758 r2044373  
    1010
    1111    /** Plugin version **/
    12     const PLUGIN_VERSION = '2.5';
     12    const PLUGIN_VERSION = '2.5.1';
    1313
    1414    public $refresh_link_text;
     
    302302                    .'"autoRefresh":'.$auto_refresh.', '
    303303                    .'"dynamicFetch":'.$dynamic_fetch.', '
    304                     .'"before":"'.addslashes($before).'", '
    305                     .'"after":"'.addslashes($after).'", '
    306                     .'"beforeAttribution":"'.addslashes($before_attribution).'", '
    307                     .'"afterAttribution":"'.addslashes($after_attribution).'", '
     304                    .'"before":"'.htmlentities(addslashes($before)).'", '
     305                    .'"after":"'.htmlentities(addslashes($after)).'", '
     306                    .'"beforeAttribution":"'.htmlentities(addslashes($before_attribution)).'", '
     307                    .'"afterAttribution":"'.htmlentities(addslashes($after_attribution)).'", '
    308308                .'};';
    309309
  • quotes-collection/trunk/js/quotes-collection.js

    r2037758 r2044373  
    5252    }
    5353    if(attribution) {
    54         display += args.beforeAttribution + attribution + args.afterAttribution;
     54        display += quotescollectionHtmlDecode(args.beforeAttribution) + attribution + quotescollectionHtmlDecode(args.afterAttribution);
    5555    }
    56     display = args.before + display + args.after;
     56    display = quotescollectionHtmlDecode(args.before) + display + quotescollectionHtmlDecode(args.after);
    5757    if(args.ajaxRefresh && !args.autoRefresh)
    5858        display += '<div class=\"navigation\"><div class=\"nav-next\"><a class=\"next-quote-link\" style=\"cursor:pointer;\" onclick=\"quotescollectionRefreshInstance(\''+args.instanceID+'\')\">'+quotescollectionAjax.nextQuote+'</a></div></div>';
     
    7474        quotescollectionAjax.autoRefreshCount = ++autoRefreshCount;
    7575    }
     76}
    7677
     78/* Thanks https://stackoverflow.com/a/34064434 */
     79function quotescollectionHtmlDecode(input) {
     80    var doc = new DOMParser().parseFromString(input, "text/html");
     81    return doc.documentElement.textContent;
    7782}
  • quotes-collection/trunk/quotes-collection.php

    r2038021 r2044373  
    44 * Plugin URI: http://srinig.com/wordpress/plugins/quotes-collection/
    55 * Description: Quotes Collection plugin with Ajax powered Random Quote sidebar widget helps you collect and display your favourite quotes in your WordPress blog/website.
    6  * Version: 2.5
     6 * Version: 2.5.1
    77 * Author: Srini G
    88 * Author URI: http://srinig.com/
  • quotes-collection/trunk/readme.txt

    r2038500 r2044373  
    7474==Changelog==
    7575
     76* **2019-03-05: Version 2.5.1**
     77    * Fix for an issue where JS arguments break HTML loop when widget is used inside certain page builders.
     78
    7679* **2019-02-23: Version 2.5**
    7780    * Gutenberg blocks included. *Note: to make use of these blocks, you should have WP 5.0 or above, or have the [Gutenberg plugin](https://wordpress.org/plugins/gutenberg/) installed and activated.*
     
    326329== Upgrade Notice ==
    327330
     331= 2.5.1 =
     332Comes with a fix for an issue where widget breaks HTML loop in some cases. Upgrade recommended.
     333
    328334= 2.5 =
    329335Major update. Gutenberg blocks included, refresh options for shortcode added, other improvements and fixes.
Note: See TracChangeset for help on using the changeset viewer.