Making WordPress.org

Changeset 10476


Ignore:
Timestamp:
12/01/2020 12:23:34 AM (4 years ago)
Author:
dd32
Message:

Trac: Mentions Handler: Bail early when the user triggering the content match on Trac is unknown / doesn't exist.

Mentions requires that the user triggering the match be known.

This does not fix the core bug - Email parsing is failing when a comment only changes summary fields and doesn't leave a comment, but thankfully those changes don't need to trigger the mentions handler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/mentions-handler.php

    r2129 r10476  
    55define( 'MENTIONED',  2 );
    66
     7require dirname( dirname( __DIR__ ) ) . '/wp-init.php';
    78require dirname( dirname( __DIR__ ) ) . '/includes/slack-config.php';
    89
     
    1213
    1314$payload = json_decode( $_POST['payload'] );
    14 
    15 $_SERVER['HTTP_HOST'] = 'wordpress.org';
    16 require WPORGPATH . 'wp-load.php';
    1715
    1816require_once WP_PLUGIN_DIR . '/wporg-notifications.php';
     
    3836
    3937$user = get_user_by( 'login', $user_login );
     38if ( ! $user ) {
     39    exit;
     40}
    4041
    4142function wporg_user_has_visited_trac( $user_login ) {
Note: See TracChangeset for help on using the changeset viewer.