Skip to content

Commit 0136fa5

Browse files
authored
PHP8.1: Fixed passing null to trim() for non-existing payment methods (#2939)
1 parent 6bbd2de commit 0136fa5

File tree

1 file changed

+4
-0
lines changed
  • app/code/core/Mage/Payment/Helper

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public function getMethodInstance($code)
4343
{
4444
$key = self::XML_PATH_PAYMENT_METHODS . '/' . $code . '/model';
4545
$class = Mage::getStoreConfig($key);
46+
if (is_null($class)) {
47+
Mage::logException(new Exception(sprintf('Unkown payment method with code "%s"', $code)));
48+
return false;
49+
}
4650
return Mage::getModel($class);
4751
}
4852

0 commit comments

Comments
 (0)