• Resolved Oliver Campion

    (@domainsupport)


    Hi,

    We are getting a lot of these since the last update …

    [03-Jul-2025 12:17:57 UTC] E_WARNING: Array to string conversion in /wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/rules.php on line 1917

    Changing that line from …

        return wfWAFUtils::json_decode(@(string)$value, true);

    …. to …

        return is_array($value) ? null : wfWAFUtils::json_decode(@(string)$value, true);

    … should resolve the issue.

    We know that we can turn off our error log but we use it to identify issues so we don’t need to be advised of that.

    Thank you.

    Oliver

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support wfphil

    (@wfphil)

    Hi @domainsupport

    Your PHP error reporting is ignoring our legitimate PHP error supression as we need to do that sometimes in our plugin.

    The warning is on wordfence/vendor/wordfence/wf-waf/src/lib/rules.php – line: 1917

    This is when firewall rules need to check if a value contains specific values in JSON data.  If the data being decoded isn’t JSON, a warning could occur even if it’s a string but not valid JSON. The warning on arrays occurs in newer PHP versions so we’ll look at preventing it, but the suppression was originally intended to handle invalid JSON of any kind, and would still be necessary.

    Thread Starter Oliver Campion

    (@domainsupport)

    Yes, we need to see all errors incase there’s anything important that needs to be dealt with.

    To help you, the issue arrises from admin-ajax requests like this …

    [wp-check-locked-posts] => Array
    (
    [0] => post-xxxx
    [1] => post-xxxx
    [2] => post-xxxx
    [3] => post-xxxx
    [4] => post-xxxx
    )

    So this will happen every time an admin Posts screen is loaded.

    Oliver

    Plugin Support wfphil

    (@wfphil)

    Hi @domainsupport

    Thank you for the update. Please refer to my last reply.

    Jason

    (@galapogos01)

    When will a fixed be released for this? We’re seeing loads of the same ajax errors when viewing WooCommerce orders.

    • This reply was modified 4 months, 2 weeks ago by Jason.
Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.