Making WordPress.org


Ignore:
Timestamp:
01/18/2019 01:01:30 AM (5 years ago)
Author:
coreymckrill
Message:

WordCamp: Add ignore list for error slack notifications

Some errors are triggered by 3rd party plugins or Core itself, and these mostly
don't need to get piped into Slack. This gives us a mechanism for muting
noisy error notifications that we don't plan to fix anytime soon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php

    r8087 r8093  
    467467    }
    468468
    469     $error_whitelist = array(
     469    $error_safelist = [
    470470        E_ERROR,
    471471        E_USER_ERROR,
     
    476476        E_DEPRECATED,
    477477        E_WARNING,
    478     );
    479 
    480     if ( ! in_array( $err_no, $error_whitelist ) ) {
     478    ];
     479
     480    if ( ! in_array( $err_no, $error_safelist ) ) {
     481        return false;
     482    }
     483
     484    // Always use the ABSPATH constant in the keys here to avoid path disclosure.
     485    $error_ignorelist = [
     486        // See https://core.trac.wordpress.org/ticket/29204
     487        ABSPATH . 'wp-includes/SimplePie/Registry.php:215' => 'Non-static method WP_Feed_Cache::create() should not be called statically',
     488    ];
     489
     490    if ( isset( $error_ignorelist[ "$file:$line" ] ) && false !== strpos( $err_msg, $error_ignorelist[ "$file:$line" ] ) ) {
    481491        return false;
    482492    }
     
    516526    $domain    = get_site_url();
    517527    $page_slug = esc_html( trim( $_SERVER['REQUEST_URI'], '/' ) );
    518     $text      = $text . "Message : \"$err_msg\" occured on \"$file:$line\" \n Domain: $domain \n Page: $page_slug \n Error type: $err_no";
     528    $text      = $text . "Message : \"$err_msg\" occurred on \"$file:$line\" \n Domain: $domain \n Page: $page_slug \n Error type: $err_no";
    519529
    520530    $message = array(
Note: See TracChangeset for help on using the changeset viewer.