Making WordPress.org

Changeset 11021


Ignore:
Timestamp:
06/08/2021 06:20:45 AM (5 years ago)
Author:
dd32
Message:

API: Slack Trac Bot: Properly access static members of the class through self:: rather than $this->.

Additionally, re-enable #12345-core for #core-editor, ensuring that only #12345 is disabled.

Follow up to [11020].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/slack/trac/bot.php

    r11020 r11021  
    5353        $tickets      = array();
    5454
    55         // If the channel is not GitHub centric, match #1234 as a Trac ticket
    56         if ( ! in_array( $this->get_channel(), $this->github_channels, true ) ) {
    57             preg_match_all( "/(?:\s|^|\()#(?<id>$digits)(?:\-($ticket_tracs))?\b/", $text, $tickets, PREG_SET_ORDER );
    58         }
     55        // If the channel is not GitHub centric, require the trac to be suffixed like #1234-core
     56        $require_trac = in_array( $this->get_channel(), self::$github_channels, true );
     57        $require_trac = $require_trac ? '' : '?'; // regex optional.
     58
     59        preg_match_all( "/(?:\s|^|\()#(?<id>$digits)(?:\-($ticket_tracs)){$require_trac}\b/", $text, $tickets, PREG_SET_ORDER );
    5960
    6061        // Always match trac-prefixed Tickets
Note: See TracChangeset for help on using the changeset viewer.