Skip to content

Commit ed43407

Browse files
committed
Fix checking if image is in media directory
1 parent b2f1417 commit ed43407

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/Catalog/Model/Category/FileInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function getMediaDirectory()
7676
private function getBaseDirectory()
7777
{
7878
if (!isset($this->baseDirectory)) {
79-
$this->baseDirectory = $this->filesystem->getDirectoryRead(DirectoryList::ROOT);
79+
$this->baseDirectory = $this->filesystem->getDirectoryRead(DirectoryList::PUB);
8080
}
8181

8282
return $this->baseDirectory;

app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function setUp()
5757

5858
$this->filesystem->expects($this->any())
5959
->method('getDirectoryRead')
60-
->with(DirectoryList::ROOT)
60+
->with(DirectoryList::PUB)
6161
->willReturn($this->baseDirectory);
6262

6363
$this->mime = $this->getMockBuilder(Mime::class)

0 commit comments

Comments
 (0)