Skip to content

Commit c08aff1

Browse files
committed
Testimonial Shortcode: sanitize the 'image' attr
1 parent e744777 commit c08aff1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/custom-post-types/testimonial.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ static function jetpack_testimonial_shortcode( $atts ) {
434434
$atts['display_content'] = false;
435435
}
436436

437+
if ( $atts['image'] && 'true' != $atts['image'] ) {
438+
$atts['image'] = false;
439+
}
440+
437441
$atts['columns'] = absint( $atts['columns'] );
438442

439443
$atts['showposts'] = intval( $atts['showposts'] );
@@ -507,14 +511,14 @@ static function jetpack_testimonial_shortcode_html( $atts ) {
507511
<div class="testimonial-entry <?php echo esc_attr( self::get_testimonial_class( $testimonial_index_number, $atts['columns'] ) ); ?>">
508512
<?php
509513
// The content
510-
if ( false != $atts['display_content'] ): ?>
514+
if ( false !== $atts['display_content'] ): ?>
511515
<div class="testimonial-entry-content"><?php the_excerpt(); ?></div>
512516
<?php endif; ?>
513517

514518
<span class="testimonial-entry-title">&#8213; <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php echo esc_attr( the_title_attribute( ) ); ?>"><?php the_title(); ?></a></span>
515519
<?php
516520
// Featured image
517-
if ( false != $atts['image'] ):
521+
if ( false !== $atts['image'] ) :
518522
echo self::get_testimonial_thumbnail_link( $post_id );
519523
endif;
520524
?>

0 commit comments

Comments
 (0)