Site Health: Check if session_status()
exists before calling it.
Props bgermann. Fixes #50862. git-svn-id: https://develop.svn.wordpress.org/trunk@48742 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
55d73734e4
commit
f840046391
@ -1115,7 +1115,7 @@ class WP_Site_Health {
|
|||||||
'test' => 'php_sessions',
|
'test' => 'php_sessions',
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( PHP_SESSION_ACTIVE === session_status() ) {
|
if ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {
|
||||||
$result['status'] = 'critical';
|
$result['status'] = 'critical';
|
||||||
|
|
||||||
$result['label'] = __( 'An active PHP session was detected' );
|
$result['label'] = __( 'An active PHP session was detected' );
|
||||||
|
@ -555,7 +555,7 @@ function wp_edit_theme_plugin_file( $args ) {
|
|||||||
$url = admin_url();
|
$url = admin_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( PHP_SESSION_ACTIVE === session_status() ) {
|
if ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {
|
||||||
// Close any active session to prevent HTTP requests from timing out
|
// Close any active session to prevent HTTP requests from timing out
|
||||||
// when attempting to connect back to the site.
|
// when attempting to connect back to the site.
|
||||||
session_write_close();
|
session_write_close();
|
||||||
|
Loading…
Reference in New Issue
Block a user