Make WordPress Core

Changeset 59967


Ignore:
Timestamp:
03/11/2025 11:37:56 AM (2 months ago)
Author:
audrasjb
Message:

Media: Allow super-admin to access files of archived sites.

This changeset fixes an issue in multisite installations where archived sites remain accessible to network administrators, but the associated files do not. The previous implementation was checking if the blog is archived, marked as spam, or deleted, to subsequently return a 404 error for file requests. However, this did not account for network administrators who should retain access to these files.

Props antwortzeit, jeremyfelt, debarghyabanerjee, audrasjb.
Fixes #36803.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-files.php

    r59634 r59967  
    2121ms_file_constants();
    2222
    23 if ( '1' === $current_blog->archived || '1' === $current_blog->spam || '1' === $current_blog->deleted ) {
     23if ( ! is_super_admin() && ( '1' === $current_blog->archived || '1' === $current_blog->spam || '1' === $current_blog->deleted ) ) {
    2424    status_header( 404 );
    2525    die( '404 — File not found.' );
Note: See TracChangeset for help on using the changeset viewer.