From f840046391cd35fb7dc9b6922de3e03a22455288 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 6 Aug 2020 00:23:13 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/class-wp-site-health.php | 2 +- src/wp-admin/includes/file.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index f20bc947c3..b3faee728c 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -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' ); diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 7bb04f8fc3..e22292c4f8 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -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();