Support » Plugin: NinjaFirewall (WP Edition) - Advanced Security » File edit function doesn’t work for PHP files anymore

  • Resolved Olaf Lederer

    (@finalwebsites)


    Hi,

    there is a problem with WP 4.9 and your plugin.
    With 4.9 there is a new check for a valid php file after using the dashboards file editor. The strange thing is that it still works with css files.
    It happens to me with multiple themes and always with the firewall plugin enabled.
    How can you test it?
    Install your plugin with default settings on a website which is using the latest WP version. Try the edit file function for your theme’s function.php.

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

    (@bruandet)

    Hi,

    It’s a known issue, I reported it six months ago to core.trac.wordpress.org: https://core.trac.wordpress.org/ticket/43358
    But it is still in the “Awaiting Review” state.

    You can edit wp-admin/includes/file.php, search for:

       // Make sure PHP process doesn't die before loopback requests complete.
       @set_time_limit( 300 );
    
       // Time to wait for loopback requests to finish.
       $timeout = 100;
    

    Insert @session_write_close(); so that it looks like this:

       // Make sure PHP process doesn't die before loopback requests complete.
       @set_time_limit( 300 );
       @session_write_close();
       // Time to wait for loopback requests to finish.
       $timeout = 100;
    

    Obviously, next time you update WordPress you will likely need to apply the above changes again.

    Thanks for the information. I searched the web before but there wasn’t that information available. (at least for my search :))

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘File edit function doesn’t work for PHP files anymore’ is closed to new replies.