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.


Built from https://develop.svn.wordpress.org/trunk@59967


git-svn-id: http://core.svn.wordpress.org/trunk@59309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2025-03-11 11:39:23 +00:00
parent e7f4ec0694
commit 2ff4db022b
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ if ( ! is_multisite() ) {
ms_file_constants();
if ( '1' === $current_blog->archived || '1' === $current_blog->spam || '1' === $current_blog->deleted ) {
if ( ! is_super_admin() && ( '1' === $current_blog->archived || '1' === $current_blog->spam || '1' === $current_blog->deleted ) ) {
status_header( 404 );
die( '404 — File not found.' );
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-beta1-59966';
$wp_version = '6.8-beta1-59967';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.