Fix FileHandler::checkMemoryLoadImage() returning false if memory_limit is actually unlimited

This commit is contained in:
Kijin Sung 2021-06-19 23:16:08 +09:00
parent 633bc340e7
commit 93fa7a46ce

View file

@ -467,8 +467,13 @@ class FileHandler
$channels = 6; //for png
}
$memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $channels / 8 + $K64 ) * $TWEAKFACTOR);
$memoryLimit = self::returnBytes(ini_get('memory_limit'));
if($memoryLimit < 0)
$memoryLimit = ini_get('memory_limit');
if($memoryLimit <= 0)
{
return true;
}
$memoryLimit = self::returnBytes($memoryLimit);
if($memoryLimit <= 0)
{
return true;
}