WordPress.org

Make WordPress Core

Ticket #7157: wp-app.php.4.diff

File wp-app.php.4.diff, 944 bytes (added by AlanJCastonguay, 12 years ago)

Should use 403 Forbidden instead.

  • wp-app.php

     
    197197
    198198                // check to see if AtomPub is enabled
    199199                if( !get_option( 'enable_app' ) )
    200                         $this->not_allowed( sprintf( __( 'AtomPub services are disabled on this blog.  An admin user can enable them at %s' ), admin_url('options-writing.php') ) );
     200                        $this->forbidden( sprintf( __( 'AtomPub services are disabled on this blog.  An admin user can enable them at %s' ), admin_url('options-writing.php') ) );
    201201
    202202                // dispatch
    203203                foreach($this->selectors as $regex => $funcs) {
     
    939939                exit;
    940940        }
    941941
     942        function forbidden($reason='') {
     943                log_app('Status','403: Forbidden');
     944                header('Content-Type: text/plain');
     945                status_header('403');
     946                echo $reason;
     947                exit;
     948        }
     949
    942950        function not_found() {
    943951                log_app('Status','404: Not Found');
    944952                header('Content-Type: text/plain');