Make WordPress Core

Changeset 48746


Ignore:
Timestamp:
08/07/2020 01:41:55 PM (4 years ago)
Author:
desrosj
Message:

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

Merges [48742] to the 5.5 branch.
Reviewed by desrosj, SergeyBiryukov.
Props bgermann.
Fixes #50862.

Location:
branches/5.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/wp-admin/includes/class-wp-site-health.php

    r48608 r48746  
    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
  • branches/5.5/src/wp-admin/includes/file.php

    r48657 r48746  
    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.