Skip to content

Commit babbdb6

Browse files
authored
[BUGFIX] Solved problem with Product Image upload
Notice: Undefined index: extension in ..
1 parent 24f6c00 commit babbdb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Image/Adapter/Gd2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
public function open($filename)
3333
{
3434
$pathInfo = pathinfo($filename);
35-
if (!in_array($pathInfo['extension'], $this->settings->getExtraFiletypes())) {
35+
if (!key_exists('extension', $pathInfo) || !in_array($pathInfo['extension'], $this->settings->getExtraFiletypes())) {
3636
parent::open($filename);
3737
}
3838
}
@@ -50,7 +50,7 @@ public function save($destination = null, $newName = null)
5050
{
5151
$fileName = $this->_prepareDestination($destination, $newName);
5252
$pathInfo = pathinfo($fileName);
53-
if (!in_array($pathInfo['extension'], $this->settings->getExtraFiletypes())) {
53+
if (!key_exists('extension', $pathInfo) || !in_array($pathInfo['extension'], $this->settings->getExtraFiletypes())) {
5454
parent::save($destination, $newName);
5555
}
5656
}

0 commit comments

Comments
 (0)