• L.S.,

    First of all THANK YOU! I’ve been using WordFence for years and it makes me feel much better knowing it’s running on my sites.

    Today, when I was going through the scan results, I tried to view a file diff for a “modified plugin file” and got the following PHP error and no diff shown (original showed, the modified version panel was blank):

    Backtrace from warning 'file_get_contents() [function.file-get-contents.php]: Filename cannot be empty' at /webroot/wp-content/plugins/wordfence/lib/wordfenceClass.php 4855:
    
        /webroot/wp-content/plugins/wordfence/lib/wordfenceClass.php 4855 calling file_get_contents()
        /webroot/wp-content/plugins/wordfence/lib/wordfenceClass.php 4549 calling wfFunc_diff()
        calling templateRedir()
        /webroot/wp-includes/class-wp-hook.php 286 calling call_user_func_array()
        /webroot/wp-includes/class-wp-hook.php 310 calling apply_filters()
        /webroot/wp-includes/plugin.php 453 calling do_action()
        /webroot/wp-includes/template-loader.php 12 calling do_action()
        /webroot/wp-blog-header.php 19 calling require_once()
        /webroot/index.php 17 calling require()

    When I then just tried to view the modified file, I got an We could not open the requested file for reading. The error was: Redefining already defined constructor for class SomeClassFromAnotherPlugin error.

    I fixed the class from the other plugin, uploaded the updated file and tried again and now I get We could not open the requested file for reading. The error was: without any indication of the error.

    While the file_get_contents() notice shows up in my PHP error log, the notice about the PHP 4 class constructor does not.

    I haven’t looked at the related code in the WF plugin, but this gives me the impression that you turn error reporting off for certain features, which makes debugging this so much harder.

    Aside from the above issue with the diff viewing and the file display needing to be fixed, it would be great if you would not turn off error_reporting, but instead possibly just turn off display_errors. That way errors will still be logged if the administrator has configured them to be.

    Hope this information helps & I look forward to the next version of WF!

    Smile,
    Juliette

    PHP 5.6.36
    WP 4.9.6
    WF 7.1.6

    • This topic was modified 6 years, 6 months ago by Juliette Reinders Folmer. Reason: Updated PHP version number to be more exact
Viewing 1 replies (of 1 total)
  • Hi Juliette,

    Thanks for all the details you shared on this thread. I’ve passed this one onto one of our QA team members and he took a look and it seems that we didn’t disable error reporting in this part. Could this be related to the site’s error_reporting value?

    To continue investigating this issue, could you please mention some more details about this “SomeClassFromAnotherPlugin” and also which file was reported as being modified in the scan results? so we can try reproducing this issue.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP errors on diff/file view for changed files’ is closed to new replies.