Support » Fixing WordPress » Since PHP 7.4: Notice: Trying to access array offset on value of type bool

  • Using WP 5.5 and after upgrading PhP 7.2 to 7.4 I got following Notice & Warning on the Dashboard:
    Notice: Trying to access array offset on value of type bool in /homepages/…/wp-admin/includes/class-wp-privacy-policy-content.php on line 96

    Notice: Trying to access array offset on value of type bool in /homepages/…/wp-admin/includes/class-wp-privacy-policy-content.php on line 97

    Warning: Cannot modify header information – headers already sent by (output started at /homepages/…/wp-admin/includes/class-wp-privacy-policy-content.php:96) in /homepages/../wp-admin/admin-header.php on line 9

    Line 96 & 97 says:
    ‘plugin_name’ => $data[‘plugin_name’],
    ‘policy_text’ => $data[‘policy_text’],

    I inactivated all aktive Plugins…but no change.

    So I don’t know, where is the cause of this failure.

    need help, please!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Ask your hosting service what is the proper way to disable the PHP display_errors setting on your hosting.

    No public site should ever have display_errors enabled, but many do by default. Turn it off.

    hi Otto, thanx for you answer.
    It’s not the hoster. I put the display_error on in this case.
    As I said the errors doesn’t show up on the public site, just on the admin area.
    …and the debug.log is full of the above error notices & warnings.

    treibstoff

    (@treibstoff)

    It’s the WordPress Core producing the Errors:
    „PHP 7.4 introduces a „Trying to access array offset on value of type …“ warning for accessing null/bool/int/float/resource (everything but array, string and object) as if it were an array.“
    and
    „I expect more issues to be reported – both in Core as well as in plugins and themes – once PHP 7.4 is out and starting to be used for real.“

    https://core.trac.wordpress.org/ticket/47704

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