Skip to content

Commit

Permalink
Ensure null value not passed to str_replace (#2901)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdavenport authored and fballiano committed Jan 9, 2023
1 parent 37fbac1 commit 390a79c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/code/core/Mage/Core/Model/Resource/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function loadToXml(Mage_Core_Model_Config $xmlConfig, $condition = null)
if ($r['scope'] !== 'default') {
continue;
}
$value = str_replace($substFrom, $substTo, $r['value']);
$value = str_replace($substFrom, $substTo, (string)$r['value']);
$xmlConfig->setNode('default/' . $r['path'], $value);
}

Expand All @@ -107,7 +107,7 @@ public function loadToXml(Mage_Core_Model_Config $xmlConfig, $condition = null)
if ($r['scope'] !== 'websites') {
continue;
}
$value = str_replace($substFrom, $substTo, $r['value']);
$value = str_replace($substFrom, $substTo, (string)$r['value']);
if (isset($websites[$r['scope_id']])) {
$nodePath = sprintf('websites/%s/%s', $websites[$r['scope_id']]['code'], $r['path']);
$xmlConfig->setNode($nodePath, $value);
Expand Down Expand Up @@ -136,7 +136,7 @@ public function loadToXml(Mage_Core_Model_Config $xmlConfig, $condition = null)
if ($r['scope'] !== 'stores') {
continue;
}
$value = str_replace($substFrom, $substTo, $r['value']);
$value = str_replace($substFrom, $substTo, (string)$r['value']);
if (isset($stores[$r['scope_id']])) {
$nodePath = sprintf('stores/%s/%s', $stores[$r['scope_id']]['code'], $r['path']);
$xmlConfig->setNode($nodePath, $value);
Expand Down

0 comments on commit 390a79c

Please sign in to comment.