WordPress.org

Making WordPress.org

Changeset 8260


Ignore:
Timestamp:
02/15/2019 08:50:48 PM (8 months ago)
Author:
coreymckrill
Message:

WordCamp: Add control operator check to custom error handler

This should ensure that expressions that include explicit error suppression,
such as @opendir and @closedir, are in fact suppressed when their errors are
piped through our custom error handler.

File:
1 edited

Legend:

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

    r8143 r8260  
    462462 */
    463463function send_error_to_slack( $err_no, $err_msg, $file, $line ) {
    464 
    465464    if ( ! init_error_handling() ) {
     465        return false;
     466    }
     467
     468    // Checks to see if the error-throwing expression is prepended with the @ control operator.
     469    // See https://secure.php.net/manual/en/function.set-error-handler.php
     470    if ( 0 === error_reporting() ) {
    466471        return false;
    467472    }
     
    486491        // See https://core.trac.wordpress.org/ticket/29204
    487492        ABSPATH . 'wp-includes/SimplePie/Registry.php:215' => 'Non-static method WP_Feed_Cache::create() should not be called statically',
    488 
    489         // It seems like WPSC shouldn't assume that these files/folders always exist, and should check first instead.
    490         WP_CONTENT_DIR . '/plugins/wp-super-cache/wp-cache-phase2.php:2359' => 'failed to open dir: No such file or directory',
    491         WP_CONTENT_DIR . '/plugins/wp-super-cache/wp-cache-phase2.php:2901' => 'failed to open dir: No such file or directory',
    492         WP_CONTENT_DIR . '/plugins/wp-super-cache/wp-cache-phase2.php:3033' => 'No such file or directory',
    493493    ];
    494494
Note: See TracChangeset for help on using the changeset viewer.