Skip to content

Commit

Permalink
Fix duplicate blog id suffix on multisite
Browse files Browse the repository at this point in the history
  • Loading branch information
calind committed Sep 26, 2022
1 parent 6862508 commit 1f6947c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Stack/MediaStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ public function filterUploadDir(array $uploads) : array
// If multisite (and if not the main site in a post-MU network)
// NOTICE: we support only post-MU network setups
if (is_multisite() && !(is_main_network() && is_main_site() && defined('MULTISITE'))) {
$basedir .= '/sites/' . get_current_blog_id();
$suffix = '/sites/' . get_current_blog_id();
if (!$this->endsWith($basedir, $suffix)) {
$basedir .= $suffix;
}
}

$uploads['basedir'] = $basedir;
Expand Down

0 comments on commit 1f6947c

Please sign in to comment.