Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mem limit #286

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function _getMemoryLimit()
{
$memoryLimit = trim(strtoupper(ini_get('memory_limit')));

if (!isSet($memoryLimit[0])){
if (!isSet($memoryLimit)){
Copy link
Contributor

@LeeSaferite LeeSaferite Jun 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is doing what you think it's doing.
$memoryLimit = trim(strtoupper(ini_get('memory_limit'))); will always set the variable. As far as I can tell, empty($memoryLimit) is the proper check in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe keep it the way it is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me ... I see no need to change this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of isset() on an empty string is true. This should be if (empty($memoryLimit)) {.

php > $a = '';
php > var_dump(isset($a));
php shell code:1:
bool(true)

$memoryLimit = "128M";
}

Expand Down