Making WordPress.org

Changeset 8180


Ignore:
Timestamp:
02/02/2019 12:48:33 PM (6 years ago)
Author:
ocean90
Message:

Slack: The fallback field should not contain any markup and is therefore an invalid value for mrkdwn_in.

Location:
sites/trunk/common/includes/slack/trac
Files:
2 edited

Legend:

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

    r8177 r8180  
    4747
    4848        $text     = "*$username <$url|$revision> by $author*\n$log";
    49         $fallback = "$revision by $author: $log";
     49        $fallback = "$username $revision by $author";
    5050
    5151        $this->send->set_username( $username );
     
    5555            'text'      => $text,
    5656            'fallback'  => $fallback,
    57             'mrkdwn_in' => array( 'text', 'fallback' ),
     57            'mrkdwn_in' => array( 'text' ),
    5858        ) );
    5959    }
  • sites/trunk/common/includes/slack/trac/commit.php

    r8179 r8180  
    2828
    2929        $username = $this->trac->get_commit_username();
    30         $url      = $this->get_url();
    3130        $revision = 'r' . $this->id;
    3231        $author   = $this->author;
     
    3534        $attachment = [];
    3635
    37         $attachment['text']      = "*$username <$url|$revision> by $author*\n$message";
    38         $attachment['fallback']  = "$revision by $author: $message";
    39         $attachment['mrkdwn_in'] = [ 'text', 'fallback' ];
     36        $attachment['title']      = "$username $revision";
     37        $attachment['title_link'] = $this->get_url();
     38
     39        $attachment['author_name'] = $author;
     40        $attachment['author_icon'] = sprintf( 'https://wordpress.org/grav-redirect.php?user=%s&s=32', $author );
     41
     42        $attachment['text']      = $message;
     43        $attachment['fallback']  = "$username $revision by $author";
     44        $attachment['mrkdwn_in'] = [ 'text' ];
    4045
    4146        $attachment['ts']          = $this->created;
Note: See TracChangeset for help on using the changeset viewer.