You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: files/acl/acl.php
+21-14
Original file line number
Diff line number
Diff line change
@@ -72,25 +72,32 @@ function get_option_as_bool_if_exists( $option_name ) {
72
72
/**
73
73
* Check if the path is allowed for the current context.
74
74
*
75
-
* @param string $file_path Path to the file, minus the `/wp-content/uploads/` bit. It's the second portion returned by `Pre_Wp_Utils\prepare_request()`
75
+
* @param string $file_path Path to the file, minus the `/wp-content/uploads/` bit.
76
+
* This is the second portion returned by `Pre_Wp_Utils\prepare_request()`.
77
+
* @return bool True if the file path is valid for the current site, false otherwise.
76
78
*/
77
79
functionis_valid_path_for_site( $file_path ) {
78
-
if ( ! is_multisite() ) {
79
-
returntrue;
80
-
}
81
-
82
-
// If main site, don't allow access to /sites/ subdirectories.
83
-
if ( is_main_network() && is_main_site() ) {
84
-
if ( 0 === strpos( $file_path, 'sites/' ) ) {
85
-
returnfalse;
80
+
$is_valid = true;
81
+
82
+
if ( is_multisite() ) {
83
+
// If main site, don't allow access to `/sites/` subdirectories.
0 commit comments