Skip to content

Commit e243cd7

Browse files
authored
Merge branch 'main' into phpstan-v2
2 parents 3d19693 + ac9bbae commit e243cd7

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.phpstan.dist.baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,12 +4104,6 @@ parameters:
41044104
count: 2
41054105
path: app/code/core/Mage/Directory/Model/Observer.php
41064106

4107-
-
4108-
message: '#^Parameter \#2 \$countryId of method Mage_Directory_Model_Resource_Region\:\:_loadByCountry\(\) expects int, string given\.$#'
4109-
identifier: argument.type
4110-
count: 2
4111-
path: app/code/core/Mage/Directory/Model/Resource/Region.php
4112-
41134107
-
41144108
message: '#^Left side of && is always true\.$#'
41154109
identifier: booleanAnd.leftAlwaysTrue

app/code/core/Mage/Checkout/controllers/CartController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ public function estimatePostAction()
533533
$regionId = (string) $this->getRequest()->getParam('region_id');
534534
$region = (string) $this->getRequest()->getParam('region');
535535

536+
try {
537+
Mage::getModel('directory/country')->loadByCode($country);
538+
} catch (Mage_Core_Exception $e) {
539+
$this->_getSession()->addError($e->getMessage());
540+
$this->_goBack();
541+
return;
542+
}
543+
536544
$this->_getQuote()->getShippingAddress()
537545
->setCountryId($country)
538546
->setCity($city)

app/code/core/Mage/Directory/Model/Resource/Region.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function _getLoadSelect($field, $value, $object)
8484
* Load object by country id and code or default name
8585
*
8686
* @param Mage_Core_Model_Abstract $object
87-
* @param int $countryId
87+
* @param string $countryId
8888
* @param string $value
8989
* @param string $field
9090
*

0 commit comments

Comments
 (0)