Making WordPress.org


Ignore:
Timestamp:
03/03/2020 01:15:37 AM (4 years ago)
Author:
dd32
Message:

Trac Notifications: Output some unique HTTP error codes for failure states of the Trac-based HTTP server class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-http-server.php

    r2028 r9561  
    1616    function serve( $method, $secret, $arguments ) {
    1717        if ( ! method_exists( 'Trac_Notifications_DB', $method ) || $method[0] === '_' ) {
     18            header( ( $_SERVER["SERVER_PROTOCOL"] ?: 'HTTP/1.0' ) . ' 404 Method Not Found', true, 404 );
    1819            exit;
    1920        }
    2021
    21         if ( $secret !== $this->secret ) {
     22        if ( ! hash_equals( $this->secret,  $secret ) ) {
     23            header( ( $_SERVER["SERVER_PROTOCOL"] ?: 'HTTP/1.0' ) . ' 403 Forbidden', true, 403 );
    2224            exit;
    2325        }
Note: See TracChangeset for help on using the changeset viewer.