WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/15/2020 07:43:50 PM (17 months ago)
Author:
SergeyBiryukov
Message:

Administration: When editing a plugin or theme file, close any active PHP session.

This prevents HTTP requests from timing out when attempting to connect back to the site.

Props bruandet, vjik, donmhico, SergeyBiryukov.
Fixes #43358.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r47398 r47457  
    551551            $url = admin_url();
    552552        }
     553
     554        if ( PHP_SESSION_ACTIVE === session_status() ) {
     555            // Close any active session to prevent HTTP requests from timing out
     556            // when attempting to connect back to the site.
     557            session_write_close();
     558        }
     559
    553560        $url                    = add_query_arg( $scrape_params, $url );
    554561        $r                      = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
Note: See TracChangeset for help on using the changeset viewer.