Skip to content

Commit 1165525

Browse files
ENGCOM-3302: MAGE_DIRS overwrite fix in pub/index.php #18727
- Merge Pull Request #18727 from mmenozzi/magento2:mage-dirs-overwrite-in-pub-index-fix - Merged commits: 1. c34e734
2 parents 77af5d6 + c34e734 commit 1165525

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pub/index.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@
2525
}
2626

2727
$params = $_SERVER;
28-
$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [
29-
DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
30-
DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
31-
DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
32-
DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
33-
];
28+
$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = array_replace_recursive(
29+
$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS],
30+
[
31+
DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
32+
DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
33+
DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
34+
DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
35+
]
36+
);
3437
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
3538
/** @var \Magento\Framework\App\Http $app */
3639
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);

0 commit comments

Comments
 (0)