Easy Table of Contents - Version 1.6.1

Version Description

Requires WordPress >

Download this release

Release Info

Developer shazahm1@hotmail.com
Plugin Icon 128x128 Easy Table of Contents
Version 1.6.1
Comparing to
See all releases

Code changes from version 1.6 to 1.6.1

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: table of contents, toc
5
  Requires at least: 4.3
6
  Tested up to: 4.9
7
  Requires PHP: 5.3
8
- Stable tag: 1.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -90,6 +90,10 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
90
 
91
  == Changelog ==
92
 
 
 
 
 
93
  = 1.6 03/15/2018 =
94
  * NEW: Add `px` option for font size unit.
95
  * NEW: Add title font size and weight settings options.
@@ -237,3 +241,6 @@ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
237
 
238
  = 1.6 =
239
  Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
 
 
 
5
  Requires at least: 4.3
6
  Tested up to: 4.9
7
  Requires PHP: 5.3
8
+ Stable tag: 1.6.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
90
 
91
  == Changelog ==
92
 
93
+ = 1.6.1 03/16/2018 =
94
+ * TWEAK: Revert change made to allow HTML added via the `ez_toc_title` filter as it caused undesirable side effects.
95
+ * BUG: Ensure Smooth Scroll Offset is parsed as an integer.
96
+
97
  = 1.6 03/15/2018 =
98
  * NEW: Add `px` option for font size unit.
99
  * NEW: Add title font size and weight settings options.
241
 
242
  = 1.6 =
243
  Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
244
+
245
+ = 1.6.1 =
246
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
assets/js/front.js CHANGED
@@ -22,7 +22,7 @@ jQuery( document ).ready( function( $ ) {
22
 
23
  $( ezTOC.affixSelector ).stick_in_parent({
24
  inner_scrolling : false,
25
- offset_top : affixOffset
26
  });
27
  }
28
 
22
 
23
  $( ezTOC.affixSelector ).stick_in_parent({
24
  inner_scrolling : false,
25
+ offset_top : parseInt( affixOffset )
26
  });
27
  }
28
 
assets/js/front.min.js CHANGED
@@ -1,4 +1,4 @@
1
- jQuery(document).ready(function(a){if("undefined"!=typeof ezTOC){var f=function(b){return a('.ez-toc-widget-container .ez-toc-list a[href="#'+a(b).attr("id")+'"]')};if(0!==a(".ez-toc-widget-container.ez-toc-affix").length){var c=30;"undefined"!=typeof ezTOC.scroll_offset&&(c=ezTOC.scroll_offset);a(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:c})}a.fn.shrinkTOCWidth=function(){a(this).css({width:"auto",display:"table"});/MSIE 7\./.test(navigator.userAgent)&&a(this).css("width",
2
  "")};if(1==ezTOC.smooth_scroll){var d=hostname=pathname=qs=hash=null;a("body a").click(function(b){hostname=a(this).prop("hostname");pathname=a(this).prop("pathname");qs=a(this).prop("search");hash=a(this).prop("hash");0<pathname.length&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname);window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash&&(b=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1"),0<a(b).length?d=hash:(anchor=hash,anchor=
3
  anchor.replace("#",""),d='a[name="'+anchor+'"]',0==a(d).length&&(d="")),"undefined"!=typeof ezTOC.scroll_offset?b=-1*ezTOC.scroll_offset:(b=a("#wpadminbar"),b=0<b.length?b.is(":visible")?-30:0:0),d&&a.smoothScroll({scrollTarget:d,offset:b}))})}if("undefined"!=typeof ezTOC.visibility_hide_by_default){c=a("a.ez-toc-toggle");var e=ezTOC.visibility_hide_by_default;Cookies?1==Cookies.get("ezTOC_hidetoc")?c.data("visible",!1):c.data("visible",!0):c.data("visible",!0);e&&c.data("visible",!1);c.data("visible")||
4
  a("ul.ez-toc-list").hide();c.click(function(b){b.preventDefault();a(this).data("visible")?(a(this).data("visible",!1),Cookies&&(e?Cookies.set("ezTOC_hidetoc",null,{path:"/"}):Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"})),a("ul.ez-toc-list").hide("fast")):(a(this).data("visible",!0),Cookies&&(e?Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc",null,{path:"/"})),a("ul.ez-toc-list").show("fast"))})}a("span.ez-toc-section").waypoint(function(a){f(this.element).toggleClass("active",
1
+ jQuery(document).ready(function(a){if("undefined"!=typeof ezTOC){var f=function(b){return a('.ez-toc-widget-container .ez-toc-list a[href="#'+a(b).attr("id")+'"]')};if(0!==a(".ez-toc-widget-container.ez-toc-affix").length){var c=30;"undefined"!=typeof ezTOC.scroll_offset&&(c=ezTOC.scroll_offset);a(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:parseInt(c)})}a.fn.shrinkTOCWidth=function(){a(this).css({width:"auto",display:"table"});/MSIE 7\./.test(navigator.userAgent)&&a(this).css("width",
2
  "")};if(1==ezTOC.smooth_scroll){var d=hostname=pathname=qs=hash=null;a("body a").click(function(b){hostname=a(this).prop("hostname");pathname=a(this).prop("pathname");qs=a(this).prop("search");hash=a(this).prop("hash");0<pathname.length&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname);window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash&&(b=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1"),0<a(b).length?d=hash:(anchor=hash,anchor=
3
  anchor.replace("#",""),d='a[name="'+anchor+'"]',0==a(d).length&&(d="")),"undefined"!=typeof ezTOC.scroll_offset?b=-1*ezTOC.scroll_offset:(b=a("#wpadminbar"),b=0<b.length?b.is(":visible")?-30:0:0),d&&a.smoothScroll({scrollTarget:d,offset:b}))})}if("undefined"!=typeof ezTOC.visibility_hide_by_default){c=a("a.ez-toc-toggle");var e=ezTOC.visibility_hide_by_default;Cookies?1==Cookies.get("ezTOC_hidetoc")?c.data("visible",!1):c.data("visible",!0):c.data("visible",!0);e&&c.data("visible",!1);c.data("visible")||
4
  a("ul.ez-toc-list").hide();c.click(function(b){b.preventDefault();a(this).data("visible")?(a(this).data("visible",!1),Cookies&&(e?Cookies.set("ezTOC_hidetoc",null,{path:"/"}):Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"})),a("ul.ez-toc-list").hide("fast")):(a(this).data("visible",!0),Cookies&&(e?Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc",null,{path:"/"})),a("ul.ez-toc-list").show("fast"))})}a("span.ez-toc-section").waypoint(function(a){f(this.element).toggleClass("active",
easy-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: http://connections-pro.com/
5
  * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
- * Version: 1.6
7
  * Author: Steven A. Zahm
8
  * Author URI: http://connections-pro.com/
9
  * Text Domain: easy-table-of-contents
@@ -26,7 +26,7 @@
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Steven A. Zahm
29
- * @version 1.6
30
  */
31
 
32
  // Exit if accessed directly
@@ -45,7 +45,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
45
  * @since 1.0
46
  * @var string
47
  */
48
- const VERSION = '1.6';
49
 
50
  /**
51
  * Stores the instance of this class.
@@ -448,8 +448,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
448
  if ( in_array( $matches[ $i ][2], ezTOC_Option::get( 'heading_levels' ) ) ) {
449
 
450
  //$title = apply_filters( 'ez_toc_title', strip_tags( wp_kses_post( $matches[ $i ][0] ) ) );
451
- $title = apply_filters( 'ez_toc_title', $matches[ $i ][0] );
452
- $title = preg_replace( '/<\/?h\d[^>]*>/muU', '', $title );
453
 
454
  //$html .= '<a href="#' . self::url_anchor_target( $title ) . '">';
455
  $html .= sprintf(
@@ -782,8 +781,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
782
 
783
  $items .= '<li><a href="' . esc_url( '#' . $anchor ) . '">';
784
  //$title = apply_filters( 'ez_toc_title', strip_tags( wp_kses_post( $toc[ $i ][0] ) ) );
785
- $title = apply_filters( 'ez_toc_title', $matches[ $i ][0] );
786
- $title = preg_replace( '/<\/?h\d[^>]*>/muU', '', $title );
787
 
788
  //if ( 'decimal' == ezTOC_Option::get( 'counter' ) ) {
789
  //
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: http://connections-pro.com/
5
  * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
+ * Version: 1.6.1
7
  * Author: Steven A. Zahm
8
  * Author URI: http://connections-pro.com/
9
  * Text Domain: easy-table-of-contents
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Steven A. Zahm
29
+ * @version 1.6.1
30
  */
31
 
32
  // Exit if accessed directly
45
  * @since 1.0
46
  * @var string
47
  */
48
+ const VERSION = '1.6.1';
49
 
50
  /**
51
  * Stores the instance of this class.
448
  if ( in_array( $matches[ $i ][2], ezTOC_Option::get( 'heading_levels' ) ) ) {
449
 
450
  //$title = apply_filters( 'ez_toc_title', strip_tags( wp_kses_post( $matches[ $i ][0] ) ) );
451
+ $title = strip_tags( apply_filters( 'ez_toc_title', $matches[ $i ][0] ), apply_filters( 'ez_toc_title_allowable_tags', '' ) );
 
452
 
453
  //$html .= '<a href="#' . self::url_anchor_target( $title ) . '">';
454
  $html .= sprintf(
781
 
782
  $items .= '<li><a href="' . esc_url( '#' . $anchor ) . '">';
783
  //$title = apply_filters( 'ez_toc_title', strip_tags( wp_kses_post( $toc[ $i ][0] ) ) );
784
+ $title = strip_tags( apply_filters( 'ez_toc_title', $matches[ $i ][0] ), apply_filters( 'ez_toc_title_allowable_tags', '' ) );
 
785
 
786
  //if ( 'decimal' == ezTOC_Option::get( 'counter' ) ) {
787
  //