Skip to content

Commit ce8622c

Browse files
sreichelfballiano
andauthored
rebase (#3237)
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
1 parent e0d615e commit ce8622c

File tree

8 files changed

+11
-19
lines changed

8 files changed

+11
-19
lines changed

app/code/core/Mage/Catalog/Model/Product/Image.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,16 @@ protected function _getMemoryLimit()
251251
$memoryLimit = "128M";
252252
}
253253

254+
$value = (int)substr($memoryLimit, 0, -1);
255+
254256
if (substr($memoryLimit, -1) == 'K') {
255-
return substr($memoryLimit, 0, -1) * 1024;
257+
return $value * 1024;
256258
}
257259
if (substr($memoryLimit, -1) == 'M') {
258-
return substr($memoryLimit, 0, -1) * 1024 * 1024;
260+
return $value * 1024 * 1024;
259261
}
260262
if (substr($memoryLimit, -1) == 'G') {
261-
return substr($memoryLimit, 0, -1) * 1024 * 1024 * 1024;
263+
return $value * 1024 * 1024 * 1024;
262264
}
263265
return $memoryLimit;
264266
}

app/code/core/Mage/Core/Controller/Request/Http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function setPathInfo($pathInfo = null)
142142
if ($baseUrl && $pathInfo && (stripos($pathInfo, '/') !== 0)) {
143143
$pathInfo = '';
144144
$this->setActionName('noRoute');
145-
} elseif (($baseUrl !== null) && ($pathInfo === false)) {
145+
} elseif ($baseUrl !== null && !$pathInfo) {
146146
$pathInfo = '';
147147
} elseif ($baseUrl === null) {
148148
$pathInfo = $requestUri;

app/code/core/Mage/Core/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ public function getEscapedCSVData(array $data)
973973
$value = (string)$value;
974974

975975
$firstLetter = substr($value, 0, 1);
976-
if ($firstLetter !== false && in_array($firstLetter, ["=", "+", "-"])) {
976+
if ($firstLetter && in_array($firstLetter, ['=', '+', '-'])) {
977977
$data[$key] = ' ' . $value;
978978
}
979979
}

app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function _getColumnDefinitionFromSql($sql, $column)
8989
*
9090
* @param string $haystack
9191
* @param string $needle
92-
* @param array $replacement
92+
* @param string $replacement
9393
* @param bool $caseInsensitive
9494
* @return string
9595
*/

app/code/core/Mage/Payment/Model/Method/Cc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function validateCcNum($ccNumber)
234234
$numSum = 0;
235235

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

239239
/**
240240
* Double every second digit

app/code/core/Mage/Uploader/Helper/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ public function getDataMaxSize()
717717
public function getDataMaxSizeInBytes()
718718
{
719719
$iniSize = $this->getDataMaxSize();
720-
$size = substr($iniSize, 0, -1);
720+
$size = (int)substr($iniSize, 0, -1);
721721
$parsedSize = 0;
722722
switch (strtolower(substr($iniSize, strlen($iniSize) - 1))) {
723723
case 't':

lib/Varien/Data/Form/Element/Time.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getElementHtml()
5656

5757
if ($value = $this->getValue()) {
5858
$values = explode(',', $value);
59-
if (is_array($values) && count($values) == 3) {
59+
if (count($values) === 3) {
6060
$value_hrs = $values[0];
6161
$value_min = $values[1];
6262
$value_sec = $values[2];

phpstan.dist.baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,11 +2300,6 @@ parameters:
23002300
count: 1
23012301
path: app/code/core/Mage/Core/Model/Resource/Setup.php
23022302

2303-
-
2304-
message: "#^Binary operation \"\\.\" between \\(string\\|false\\) and array results in an error\\.$#"
2305-
count: 1
2306-
path: app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php
2307-
23082303
-
23092304
message: "#^Negated boolean expression is always false\\.$#"
23102305
count: 1
@@ -3345,11 +3340,6 @@ parameters:
33453340
count: 1
33463341
path: app/code/core/Mage/Payment/Model/Method/Abstract.php
33473342

3348-
-
3349-
message: "#^Binary operation \"\\-\" between string and int\\<\\-9, 9\\> results in an error\\.$#"
3350-
count: 1
3351-
path: app/code/core/Mage/Payment/Model/Method/Cc.php
3352-
33533343
-
33543344
message: "#^Loose comparison using \\!\\= between ''\\|'OT' and 'SS' will always evaluate to true\\.$#"
33553345
count: 1

0 commit comments

Comments
 (0)