• wp-includes/load.php:

    instead of just doing this: $_REQUEST = array_merge( $_GET, $_POST );

    It variously throws PHP errors claiming the 1st (usually) or 2nd (sometimes) argument is not an array. If I replace that with this:

    if(is_array($_GET)) { if(is_array($_POST)) $_REQUEST = array_merge( $_GET, $_POST ); else $_REQUEST = array_merge( $_GET ); } else { if(is_array($_POST)) $_REQUEST = array_merge($_POST); else $_REQUEST = ”; }

    The errors go away.

Viewing 2 replies - 1 through 2 (of 2 total)
  • If that file threw errors it would be affecting everybody and would have been noticed and fixed by now (it’s been there for 8 years), but $_POST and $_GET should be arrays even if they’re empty, so your code shouldn’t be necessary.

    Under what circumstances are you seeing these errors? What version of PHP are you running?

    • This reply was modified 7 years, 6 months ago by Jacob Peattie.
    Thread Starter snazzylene

    (@snazzylene)

    circumstances, plain old usage of the site (any access.)

    PHP 7.0.6.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp.load() makes untested assumption’ is closed to new replies.