• Hi guys,

    Thank you for this great plugin!

    After recent plugin update (or some of the recent plugin update) v6.9.0 I’ve noticed a PHP warning in my site:
    PHP Warning: rtrim() expects parameter 1 to be string, array given in ../wp-includes/formatting.php on line 2415

    I was able to trace this to cron job set by your plugin, specifically to ITSEC_File_Change_Scanner::execute_file_check() method in better-wp-security/core/modules/file-change/scanner.php file on line 119. I think the problem is actually some lines before, where you set the $dirs array. There is a call for ITSEC_Core::get_wp_upload_dir() within the array on line 106 which output array, instead of expected string, I think.

    Could you please have a look into this issue and fix in next plugin release?

    Thanks and regards,

    Oliver

Viewing 3 replies - 1 through 3 (of 3 total)
  • Steven

    (@shazahm1hotmailcom)

    I can confirm this. The ITSEC_Core::get_wp_upload_dir() method on line 106returns an array. For example:

    
    array (
      'path' => '[REDACTED]/wp-content/uploads',
      'url' => 'https://[REDACTED]/wp-content/uploads',
      'subdir' => '',
      'basedir' => '[REDACTED]/wp-content/uploads',
      'baseurl' => 'https://[REDACTED]/wp-content/uploads',
      'error' => false,
    )
    

    Which causes the PHP Warning: rtrim() expects parameter 1 to be string, array given in ../wp-includes/formatting.php on line 2415 on line 119 where the function untrailingslashit() is being called.

    I suspect line 106 should actually be $wp_upload_dir['basedir'].

    The $wp_upload_dir variable is being set on line 100 but does not appear to be used.

    If fact it appears the entire $dir array set on line 102 seems to be bugged. My guess it is actually supposed to be set using the variables directory above on lines 98-100.

    Hopefully this gets corrected soo!

    Steven

    (@shazahm1hotmailcom)

    I was able to report this directly to iTheme support. They said it’ll be corrected in the next update.

    Thread Starter WebMan Design | Oliver Juhas

    (@webmandesign)

    Cool, thank you @shazahm1hotmailcom!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP warning’ is closed to new replies.