From 3ccc1376c43c27bcd526ac3cf7ef2acd3a76a13f Mon Sep 17 00:00:00 2001 From: Sergey Date: Wed, 27 Sep 2017 10:37:04 +0300 Subject: [PATCH] fix (#27) --- MoySkladICMLParser.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/MoySkladICMLParser.php b/MoySkladICMLParser.php index 4055d20..3c8ced4 100644 --- a/MoySkladICMLParser.php +++ b/MoySkladICMLParser.php @@ -282,17 +282,18 @@ class MoySkladICMLParser } } - if (isset($assortiment['product']['image']['meta']['href'])) { - $url = $assortiment['product']['image']['meta']['href']; - } elseif (isset($assortiment['image']['meta']['href'])) { - $url = $assortiment['image']['meta']['href']; - } else { - $url = ''; - } - if (!empty($this->options['imgur'])) { - if ($url != '') { - $image = $this->requestImage($url); + + if (isset($assortiment['product']['image']['meta']['href'])) { + $imageUrl = $assortiment['product']['image']['meta']['href']; + } elseif (isset($assortiment['image']['meta']['href'])) { + $imageUrl = $assortiment['image']['meta']['href']; + } else { + $imageUrl = ''; + } + + if ($imageUrl != '') { + $image = $this->requestImage($imageUrl); } }