Making WordPress.org


Ignore:
Timestamp:
11/10/2020 04:10:17 AM (4 years ago)
Author:
dd32
Message:

Trac: Only output the 'First ticket' notice if the user exists. Some old tickets have users who no longer exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php

    r10420 r10436  
    360360        }
    361361
     362        $reporter = get_user_by( 'login', $ticket['reporter'] );
     363        if ( ! $reporter ) {
     364            return;
     365        }
     366
    362367        if ( 1 == count( $activity['tickets'] ) ) {
    363368            $output = sprintf( '<strong>Make sure %s receives a warm welcome.</strong><br/>', $ticket['reporter'] );
     
    383388
    384389        echo '<p class="ticket-note note-new-reporter">';
    385         echo get_avatar( get_user_by( 'login', $ticket['reporter'] )->user_email, 36, 'retro' );
     390        echo get_avatar( $reporter->user_email, 36, 'retro' );
    386391        echo '<span class="note">' . $output . '</span>';
    387392        echo '<span class="dashicons dashicons-welcome-learn-more"></span>';
Note: See TracChangeset for help on using the changeset viewer.