Making WordPress.org

Changeset 6480


Ignore:
Timestamp:
01/31/2018 12:24:25 AM (7 years ago)
Author:
danielbachhuber
Message:

phpunit-test-reporter: Display reporter avatars in the test results

See https://github.com/WordPress/phpunit-test-reporter/pull/55

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/result-set.php

    r6385 r6480  
    4444                    $user = get_user_by( 'id', $report->post_author );
    4545                    if ( $user ) {
    46                         $host = $user->display_name;
     46                        $host = '';
     47                        if ( ! empty( $user->user_url ) ) {
     48                            $host .= '<a target="_blank" rel="nofollow" href="' . esc_url( $user->user_url ) . '">';
     49                        }
     50                        $host .= get_avatar( $user->ID, 18, '', '', array(
     51                            'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"',
     52                        ) );
     53                        if ( ! empty( $user->user_url ) ) {
     54                            $host .= '</a>';
     55                        }
     56                        if ( ! empty( $user->user_url ) ) {
     57                            $host .= '<a target="_blank" rel="nofollow" href="' . esc_url( $user->user_url ) . '">';
     58                        }
     59                        $host .= $user->display_name;
     60                        if ( ! empty( $user->user_url ) ) {
     61                            $host .= '</a>';
     62                        }
    4763                    }
    4864                    ?>
    4965                <tr>
    5066                    <td><a href="<?php echo esc_url( get_permalink( $report->ID ) ); ?>" title="<?php echo esc_attr( $status_title ); ?>" class="<?php echo esc_attr( 'ptr-status-badge ptr-status-badge-' . strtolower( $status ) ); ?>"><?php echo esc_html( $status ); ?></a></td>
    51                     <td><?php echo esc_html( $host ); ?></td>
     67                    <td><?php echo wp_kses_post( $host ); ?></td>
    5268                    <td><?php echo esc_html( Display::get_display_php_version( $report->ID ) ); ?></td>
    5369                    <td><?php echo esc_html( Display::get_display_mysql_version( $report->ID ) ); ?></td>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/parts/single-result.php

    r6263 r6480  
    1212$user = get_user_by( 'id', $report->post_author );
    1313if ( $user ) {
    14     $host = $user->display_name;
     14    $host = '';
     15    if ( ! empty( $user->user_url ) ) {
     16        $host .= '<a target="_blank" rel="nofollow" href="' . esc_url( $user->user_url ) . '">';
     17    }
     18    $host .= get_avatar( $user->ID, 18, '', '', array(
     19        'extra_attr' => 'style="vertical-align: middle;margin-right:5px;"',
     20    ) );
     21    if ( ! empty( $user->user_url ) ) {
     22        $host .= '</a>';
     23    }
     24    if ( ! empty( $user->user_url ) ) {
     25        $host .= '<a target="_blank" rel="nofollow" href="' . esc_url( $user->user_url ) . '">';
     26    }
     27    $host .= $user->display_name;
     28    if ( ! empty( $user->user_url ) ) {
     29        $host .= '</a>';
     30    }
    1531} ?>
    1632
     
    3147    <tr>
    3248        <td><strong>Host</strong></td>
    33         <td><?php echo esc_html( $host ); ?></td>
     49        <td><?php echo wp_kses_post( $host ); ?></td>
    3450    </tr>
    3551    <tr>
Note: See TracChangeset for help on using the changeset viewer.