mirror of
https://gh.wpcy.net/https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2026-04-24 05:09:10 +08:00
22 lines
491 B
PHP
22 lines
491 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 (E_ERROR === $error['type']) {
|
|
header('HTTP/1.1 500 Internal Server Error');
|
|
}
|
|
},
|
|
0,
|
|
0
|
|
);
|