Make WordPress Core

Changeset 48742


Ignore:
Timestamp:
08/06/2020 12:23:13 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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

Props bgermann.
Fixes #50862.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r48608 r48742  
    11161116        );
    11171117
    1118         if ( PHP_SESSION_ACTIVE === session_status() ) {
     1118        if ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {
    11191119            $result['status'] = 'critical';
    11201120
  • trunk/src/wp-admin/includes/file.php

    r48657 r48742  
    556556        }
    557557
    558         if ( PHP_SESSION_ACTIVE === session_status() ) {
     558        if ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) {
    559559            // Close any active session to prevent HTTP requests from timing out
    560560            // when attempting to connect back to the site.
Note: See TracChangeset for help on using the changeset viewer.