Making WordPress.org

Changeset 3086


Ignore:
Timestamp:
05/05/2016 11:38:55 AM (8 years ago)
Author:
ocean90
Message:

Slack: Avoid two PHP notices when the Trac email doesn't contain a (Comment|Changes|Description changed) line.

See #1368.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/slack/trac/comment-handler.php

    r3072 r3086  
    9999
    100100        preg_match( '/^(Comment|Changes|Description changed) \(?by (.*[^\)])\)?:$/', array_shift( $lines ), $matches );
    101         $has_changes = $matches[1] === 'Changes';
    102         $author = $matches[2];
     101        $has_changes = ( isset( $matches[1] ) && 'Changes' === $matches[1] );
     102        $author = isset( $matches[2] ) ? $matches[2] : '';
    103103
    104104        // Remove blank line after 'Comment|Changes (by author):' or 'Description changed by author:'.
Note: See TracChangeset for help on using the changeset viewer.