Make WordPress Core

Ticket #28251: 28251.3.diff

File 28251.3.diff, 1.7 KB (added by philiparthurmoore, 12 years ago)

Add in proper attribute escaping in Twenty Ten's image attachment template part.

  • src/wp-content/themes/twentyten/loop-attachment.php

     
    1818<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    1919
    2020                                <?php if ( ! empty( $post->post_parent ) ) : ?>
    21                                         <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php echo esc_attr( sprintf( __( 'Return to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php
     21                                        <p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Return to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php
    2222                                                /* translators: %s - title of parent post */
    2323                                                printf( __( '<span class="meta-nav">&larr;</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
    2424                                        ?></a></p>
     
    110110                                                        <div class="nav-next"><?php next_image_link( false ); ?></div>
    111111                                                </div><!-- #nav-below -->
    112112<?php else : ?>
    113                                                 <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
     113                                                <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
    114114<?php endif; ?>
    115115                                                </div><!-- .entry-attachment -->
    116116                                                <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>