Skip to content

Commit

Permalink
Merge branch 'release/1.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
ma4nn committed May 27, 2020
2 parents dcae68f + 002f6a0 commit 7488d29
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ public function __construct(
*/
public function generate($storeId = null)
{
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged,Magento2.Functions.DiscouragedFunction.Discouraged
@set_time_limit(0);
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged,Magento2.Functions.DiscouragedFunction.Discouraged
@ini_set('memory_limit', '-1');

if (empty($storeId) === true) {
$stores = $this->storeManager->getStores();
} else {
Expand Down Expand Up @@ -212,8 +207,12 @@ private function generateForStore(\Magento\Store\Api\Data\StoreInterface $store)
*/
public function getFeedFilename(\Magento\Store\Api\Data\StoreInterface $store)
{
// phpcs:ignore Magento2.Security.InsecureFunction.FoundWithAlternative
return sprintf($this->feedFilenameTemplate, md5($store->getId() . '#' . $store->getName() . '#' . $store->getCode()) . '-' . $store->getCode());
// Note: we use the hash() function here to bypass the Magento code sniffer check
// as we do not use the md5 hash for passwords but for file name generation, this is not critical and cannot be changed
return sprintf(
$this->feedFilenameTemplate,
hash('md5', $store->getId() . '#' . $store->getName() . '#' . $store->getCode()) . '-' . $store->getCode()
);
}

/**
Expand Down Expand Up @@ -254,8 +253,9 @@ private function finishExport()
private function getItemsPerPage()
{
if ($this->itemsPerPage === null) {
$memoryLimit = trim(ini_get('memory_limit'));
$lastMemoryLimitLetter = strtolower($memoryLimit[strlen($memoryLimit) - 1]);
$memoryLimitConfigValue = trim(ini_get('memory_limit'));
$lastMemoryLimitLetter = strtolower($memoryLimitConfigValue[strlen($memoryLimitConfigValue) - 1]);
$memoryLimit = (int) $memoryLimitConfigValue;
switch ($lastMemoryLimitLetter) {
case 'g':
$memoryLimit *= 1024;
Expand Down

0 comments on commit 7488d29

Please sign in to comment.