Support » Plugin: NinjaFirewall (WP Edition) - Advanced Security » Question about NinjaFirewall 3.8.x and editing theme PHP files

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nintechnet

    (@nintechnet)

    Hi,

    Unfortunately, the bug ticket has never been answered : https://core.trac.wordpress.org/ticket/43358

    So I think I’ll have to try to solve the problem myself.
    Try this:
    1. Download the NinjaFirewall /lib/utils.php script.
    2. Right below the if (! defined( 'NFW_ENGINE_VERSION' ) ) { die( 'Forbidden' ); } line, enter this code:

    // ---------------------------------------------------------------------
    // Fix bug introduced in WordPress 4.9.2 (https://core.trac.wordpress.org/ticket/43358).
    
    add_filter( 'pre_http_request', 'nf_pre_http_request', 10, 3 );
    
    function nf_pre_http_request( $preempt, $r, $url ) {
    
       if ( strpos( $url, '/wp-admin/plugin-editor.php' ) !== false ) {
          @session_write_close();
       }
       return false;
    }
    
    // ---------------------------------------------------------------------
    

    This will catch the call to wp_remote_get and if the requested URL is /wp-admin/plugin-editor.php, it will close the current session.

    Thanks! I’ll give this a try.

    Tom

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.