Making WordPress.org

Changeset 8267


Ignore:
Timestamp:
02/18/2019 07:06:33 PM (6 years ago)
Author:
coreymckrill
Message:

WordCamp: Prevent shutdown function from catching ignored errors

In r8260 we added detection for the @ control operator to our custom error
handler. However, the errors were still getting reported in our logs. Further
investigation showed that our custom shutdown function, which is designed to
catch and log fatal errors that would halt things before the handler could run,
was picking up and reporting the silenced error messages. The hope is that
clearing the error message that we want silenced will prevent this from
happening.

File:
1 edited

Legend:

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

    r8261 r8267  
    455455        mkdir( ERROR_RATE_LIMITING_DIR );
    456456    }
     457
    457458    return is_dir( ERROR_RATE_LIMITING_DIR ) && is_writeable( ERROR_RATE_LIMITING_DIR );
    458459}
     
    468469    // Checks to see if the error-throwing expression is prepended with the @ control operator.
    469470    // See https://secure.php.net/manual/en/function.set-error-handler.php
    470     if ( 0 === (int) error_reporting() ) {
     471    if ( 0 === error_reporting() ) {
     472        error_clear_last();
     473
    471474        return false;
    472475    }
     
    545548
    546549    $send->send( WORDCAMP_LOGS_SLACK_CHANNEL );
     550
    547551    return false;
    548552}
Note: See TracChangeset for help on using the changeset viewer.