Make WordPress Core

Changeset 33032


Ignore:
Timestamp:
07/01/2015 05:21:55 PM (9 years ago)
Author:
obenland
Message:

Add additional escaping to credits page.

Props Viper007Bond, gtuk for initial patch.
Fixes #21523.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/credits.php

    r32845 r33032  
    7070 */
    7171function _wp_credits_build_object_link( &$data ) {
    72     $data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
     72    $data = '<a href="' . esc_url( $data[1] ) . '">' . esc_html( $data[0] ) . '</a>';
    7373}
    7474
     
    121121        }
    122122
    123         echo '<h4 class="wp-people-group">' . $title . "</h4>\n";
     123        echo '<h4 class="wp-people-group">' . esc_html( $title ) . "</h4>\n";
    124124    }
    125125
     
    141141            echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
    142142            foreach ( $group_data['data'] as $person_data ) {
    143                 echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
    144                 echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
     143                echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
     144                echo '<a href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '">';
    145145                $size = 'compact' == $group_data['type'] ? 30 : 60;
    146146                $data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
    147147                $size *= 2;
    148148                $data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
    149                 echo '<img src="' . esc_attr( $data['url'] ) . '" srcset="' . esc_attr( $data2x['url'] ) . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
    150                 echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
     149                echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
     150                echo '<a class="web" href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '">' . esc_html( $person_data[0] ) . "</a>\n\t";
    151151                if ( ! $compact )
    152152                    echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
Note: See TracChangeset for help on using the changeset viewer.