Make WordPress Core


Ignore:
Timestamp:
01/22/2015 12:41:36 AM (12 years ago)
Author:
lancewillett
Message:

Twenty Eleven: fix escaping and minor code style issues. See #29127.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/functions.php

    r30351 r31265  
    331331        <div id="headimg">
    332332                <?php
    333                 $color = get_header_textcolor();
    334                 $image = get_header_image();
    335                 if ( $color && $color != 'blank' )
    336                         $style = ' style="color:#' . $color . '"';
    337                 else
    338                         $style = ' style="display:none"';
    339                 ?>
    340                 <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
    341                 <div id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
    342                 <?php if ( $image ) : ?>
     333                $color = get_header_textcolor();
     334                $image = get_header_image();
     335                $style = 'display: none;';
     336                if ( $color && $color != 'blank' ) {
     337                        $style = 'color: #' . $color . ';';
     338                }
     339                ?>
     340                <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
     341                <div id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></div>
     342                <?php if ( $image ) : ?>
    343343                        <img src="<?php echo esc_url( $image ); ?>" alt="" />
    344344                <?php endif; ?>
     
    447447                'id' => 'sidebar-1',
    448448                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    449                 'after_widget' => "</aside>",
     449                'after_widget' => '</aside>',
    450450                'before_title' => '<h3 class="widget-title">',
    451451                'after_title' => '</h3>',
     
    457457                'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),
    458458                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    459                 'after_widget' => "</aside>",
     459                'after_widget' => '</aside>',
    460460                'before_title' => '<h3 class="widget-title">',
    461461                'after_title' => '</h3>',
     
    467467                'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
    468468                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    469                 'after_widget' => "</aside>",
     469                'after_widget' => '</aside>',
    470470                'before_title' => '<h3 class="widget-title">',
    471471                'after_title' => '</h3>',
     
    477477                'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
    478478                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    479                 'after_widget' => "</aside>",
     479                'after_widget' => '</aside>',
    480480                'before_title' => '<h3 class="widget-title">',
    481481                'after_title' => '</h3>',
     
    487487                'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
    488488                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    489                 'after_widget' => "</aside>",
     489                'after_widget' => '</aside>',
    490490                'before_title' => '<h3 class="widget-title">',
    491491                'after_title' => '</h3>',
     
    582582
    583583        if ( $class )
    584                 echo 'class="' . $class . '"';
     584                echo 'class="' . esc_attr( $class ) . '"';
    585585}
    586586
     
    718718                $galleries = get_post_galleries( get_the_ID(), false );
    719719                if ( isset( $galleries[0]['ids'] ) )
    720                         $images = explode( ',', $galleries[0]['ids'] );
     720                        $images = explode( ',', $galleries[0]['ids'] );
    721721        } else {
    722722                $pattern = get_shortcode_regex();
Note: See TracChangeset for help on using the changeset viewer.