Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed May 16, 2023
2 parents 29a8f2c + ce8622c commit 4a2f1f4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions app/code/core/Mage/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,16 @@ protected function _getMemoryLimit()
$memoryLimit = "128M";
}

$value = (int)substr($memoryLimit, 0, -1);

if (substr($memoryLimit, -1) == 'K') {
return substr($memoryLimit, 0, -1) * 1024;
return $value * 1024;
}
if (substr($memoryLimit, -1) == 'M') {
return substr($memoryLimit, 0, -1) * 1024 * 1024;
return $value * 1024 * 1024;
}
if (substr($memoryLimit, -1) == 'G') {
return substr($memoryLimit, 0, -1) * 1024 * 1024 * 1024;
return $value * 1024 * 1024 * 1024;
}
return $memoryLimit;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Controller/Request/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function setPathInfo($pathInfo = null)
if ($baseUrl && $pathInfo && (stripos($pathInfo, '/') !== 0)) {
$pathInfo = '';
$this->setActionName('noRoute');
} elseif (($baseUrl !== null) && ($pathInfo === false)) {
} elseif ($baseUrl !== null && !$pathInfo) {
$pathInfo = '';
} elseif ($baseUrl === null) {
$pathInfo = $requestUri;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ public function getEscapedCSVData(array $data)
$value = (string)$value;

$firstLetter = substr($value, 0, 1);
if ($firstLetter !== false && in_array($firstLetter, ["=", "+", "-"])) {
if ($firstLetter && in_array($firstLetter, ['=', '+', '-'])) {
$data[$key] = ' ' . $value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function _getColumnDefinitionFromSql($sql, $column)
*
* @param string $haystack
* @param string $needle
* @param array $replacement
* @param string $replacement
* @param bool $caseInsensitive
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Payment/Model/Method/Cc.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function validateCcNum($ccNumber)
$numSum = 0;

for ($i = 0; $i < strlen($cardNumber); $i++) {
$currentNum = substr($cardNumber, $i, 1);
$currentNum = (int)substr($cardNumber, $i, 1);

/**
* Double every second digit
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Uploader/Helper/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ public function getDataMaxSize()
public function getDataMaxSizeInBytes()
{
$iniSize = $this->getDataMaxSize();
$size = substr($iniSize, 0, -1);
$size = (int)substr($iniSize, 0, -1);
$parsedSize = 0;
switch (strtolower(substr($iniSize, strlen($iniSize) - 1))) {
case 't':
Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Data/Form/Element/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getElementHtml()

if ($value = $this->getValue()) {
$values = explode(',', $value);
if (is_array($values) && count($values) == 3) {
if (count($values) === 3) {
$value_hrs = $values[0];
$value_min = $values[1];
$value_sec = $values[2];
Expand Down

0 comments on commit 4a2f1f4

Please sign in to comment.