wordpress-website-lifecycle/mu-plugins/_core-php-bug-50921.php
Viktor Szépe d92113fc3f
Add MU catalogue (#70)
* Add MU catalogue

* Document and harden MU plugins

* Fixes
2026-07-23 05:36:59 +02:00

22 lines
511 B
PHP

<?php
/*
* Plugin Name: Fix PHP bug #50921: '200 OK' HTTP status despite PHP error
* Plugin URI: https://bugs.php.net/bug.php?id=50921
*/
add_action(
'shutdown',
static function () {
// display_errors needs to be disabled.
if ('1' === ini_get('display_errors')) {
return;
}
$error = error_get_last();
if (is_array($error) && $error['type'] === E_ERROR) {
header('HTTP/1.1 500 Internal Server Error');
}
},
0,
0
);