Changeset 3074011
- Timestamp:
- 04/19/2024 06:29:05 PM (2 years ago)
- Location:
- jquery-collapse-o-matic/trunk
- Files:
-
- 3 edited
-
README.md (modified) (1 diff)
-
collapse-o-matic.php (modified) (8 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jquery-collapse-o-matic/trunk/README.md
r2961946 r3074011 4 4 * Tags: collapse, expand, collapsible, expandable, expandable content, collapsable content, shortcode, hidden, hide, display, accordion, accordion, jQuery, javascript, roll-your-own, twinpictures, read me, read more, more, plugin oven 5 5 * Requires at least: 4.9 6 * Tested up to: 6. 3.17 * Stable tag: 1.8.5. 56 * Tested up to: 6.5.3 7 * Stable tag: 1.8.5.6 8 8 * Requires PHP: 7.2 9 9 * License: GPLv2 or later -
jquery-collapse-o-matic/trunk/collapse-o-matic.php
r2961946 r3074011 5 5 Plugin URI: https://pluginoven.com/plugins/collapse-o-matic/ 6 6 Description: Collapse-O-Matic adds an [expand] shortcode that wraps content into a lovely, jQuery collapsible div. 7 Version: 1.8.5. 57 Version: 1.8.5.6 8 8 Author: twinpictures, baden03 9 9 Author URI: https://twinpictures.de/ … … 30 30 * @var string 31 31 */ 32 var $version = '1.8.5. 5';32 var $version = '1.8.5.6'; 33 33 34 34 /** … … 291 291 $swapout_arr = array('<', '>', '[', ']'); 292 292 293 $allowed_tags = [ 294 "div", "span", "p", "li", "ul", "ol", "strong", "b", 295 "em", "i", "u", "h1", "h2", "h3", "h4", "h5", "h6", 296 "blockquote", "a", "img", "tr", "td", "th", "caption", "small", "cite", "q" 297 ]; 298 299 300 if(!empty($tag)){ 301 $tag = $this->filter_allowed_tags( $tag, $allowed_tags ); 302 } 303 293 304 $title = do_shortcode(str_replace($placeholder_arr, $swapout_arr, $title)); 294 305 if($swaptitle){ … … 302 313 } 303 314 //need to check for a few versions, because of new option setting. can be removed after a few revisiosn. 304 if(empty($targtag)){ 315 if(!empty($targtag)){ 316 $targtag = $this->filter_allowed_tags( $targtag, $allowed_tags ); 317 } 318 else{ 305 319 $targtag = 'div'; 306 320 } 321 307 322 308 323 if(!empty($elwraptag)){ … … 311 326 $ewclass = 'class="'.esc_attr($elwrapclass).'"'; 312 327 } 313 $ewo = '<'. esc_attr( $elwraptag ) .' '.$ewclass.'>'; 314 $ewc = '</'. esc_attr( $elwraptag ) .'>'; 328 $elwraptag = $this->filter_allowed_tags( $elwraptag, $allowed_tags ); 329 330 $ewo = '<'. $elwraptag .' '.$ewclass.'>'; 331 $ewc = '</'. $elwraptag .'>'; 315 332 } 316 333 … … 336 353 } 337 354 if($excerptpos == 'above-trigger'){ 338 $nibble = '<'. esc_attr( $excerpttag ) .' id="excerpt-'.esc_attr($id).'" class="'.esc_attr($excerptclass).'">' . $excerpt .'</'. esc_attr( $excerpttag ) .'>';355 $nibble = '<'. esc_attr( $excerpttag ) .' id="excerpt-'.esc_attr($id).'" class="'.esc_attr($excerptclass).'">'. esc_attr( $excerpt ).'</'. esc_attr( $excerpttag ) .'>'; 339 356 } 340 357 else{ … … 346 363 $swapexcerpt = do_shortcode($swapexcerpt); 347 364 $swapexcerpt = apply_filters( 'colomat_swapexcerpt', $swapexcerpt ); 348 $nibble .= '<'. esc_attr( $excerpttag ) .' id="swapexcerpt-'.esc_attr($id).'" style="display:none;">' . $swapexcerpt .'</'. esc_attr( $excerpttag ) .'>';365 $nibble .= '<'. esc_attr( $excerpttag ) .' id="swapexcerpt-'.esc_attr($id).'" style="display:none;">'. esc_attr( $swapexcerpt ).'</'. esc_attr( $excerpttag ) .'>'; 349 366 } 350 367 } … … 920 937 } 921 938 939 /** 940 * Filter $input to allow only tags from $allowed_tags array 941 */ 942 function filter_allowed_tags( $input, $allowed_tags ) { 943 $pattern = '/\A(' . implode( '|', $allowed_tags ) . ')\Z/'; 944 if ( preg_match( $pattern, $input, $matches ) ) { 945 $output = $matches[0]; 946 } else { 947 $output = ''; 948 } 949 950 return $output; 951 } 952 922 953 } // end class WP_Collapse_O_Matic 923 954 -
jquery-collapse-o-matic/trunk/readme.txt
r2961946 r3074011 5 5 Tags: collapse, expand, collapsible, expandable, expandable content, collapsable content, shortcode, hidden, hide, display, accordion, accordion, jQuery, javascript, roll-your-own, twinpictures, read me, read more, more, plugin oven 6 6 Requires at least: 4.9 7 Tested up to: 6. 3.18 Stable tag: 1.8.5. 57 Tested up to: 6.5.2 8 Stable tag: 1.8.5.6 9 9 Requires PHP: 7.2 10 10 License: GPLv2 or later … … 51 51 52 52 == Changelog == 53 54 = 1.8.5.6 = 55 * the tag, targtag and elwrap will be filtered to only allow certain tags 53 56 54 57 = 1.8.5.5 = … … 433 436 434 437 == Upgrade Notice == 435 * removed escaping on excerpt/swapexcerpt438 * the tag, targtag and elwrap will be filtered to only allow certain tags
Note: See TracChangeset
for help on using the changeset viewer.