Site Health: Check if `session_status()` exists before calling it.

Props bgermann.
Fixes #50862.
Built from https://develop.svn.wordpress.org/trunk@48742


git-svn-id: http://core.svn.wordpress.org/trunk@48504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-08-06 00:25:07 +00:00
parent ee213e333b
commit 7e1e4f379a
3 changed files with 3 additions and 3 deletions

View File

@ -1115,7 +1115,7 @@ class WP_Site_Health {
'test' => 'php_sessions',
);
if ( PHP_SESSION_ACTIVE === session_status() ) {
if ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {
$result['status'] = 'critical';
$result['label'] = __( 'An active PHP session was detected' );

View File

@ -555,7 +555,7 @@ function wp_edit_theme_plugin_file( $args ) {
$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
// when attempting to connect back to the site.
session_write_close();

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-alpha-48741';
$wp_version = '5.6-alpha-48742';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.