-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1058,7 +1058,7 @@ public function getSlugger(): AsciiSlugger | |
return $this->slugger[$locale]; | ||
} | ||
|
||
final public function getSluggerConfig(?string $locale, bool $useConvertTable = true): array | ||
final public function getSluggerConfig(?string $locale): array | ||
{ | ||
$config = [ | ||
'@' => 'at', | ||
|
@@ -1067,21 +1067,19 @@ final public function getSluggerConfig(?string $locale, bool $useConvertTable = | |
'\u2122' => 'tm' | ||
]; | ||
|
||
// @todo better config | ||
$config += Mage::helper('catalog/product_url')->getConvertTable(); | ||
|
||
if ($locale) { | ||
$configNodes = Mage::getConfig()->getNode('global/slugger/' . $locale . '/replacements'); | ||
if ($configNodes instanceof Mage_Core_Model_Config_Element) { | ||
$convertNode = Mage::getConfig()->getNode('default/url/convert/' . $locale); | ||
if ($convertNode instanceof Mage_Core_Model_Config_Element) { | ||
$custom = []; | ||
/** @var Mage_Core_Model_Config_Element $configNode */ | ||
foreach ($configNodes->children() as $configNode) { | ||
$configNode = $configNode->asArray(); | ||
$custom[$configNode['from']] = $configNode['to']; | ||
foreach ($convertNode->children() as $node) { | ||
Check failure on line 1077 in app/code/core/Mage/Catalog/Model/Url.php GitHub Actions / PHPStan / Analyze (ubuntu-latest, 8.4)
|
||
if (property_exists($node, 'from') && property_exists($node, 'to')) { | ||
$custom[(string) $node->from] = (string) $node->to; | ||
} | ||
} | ||
$config = [$locale => $config + $custom]; | ||
|
||
if ($useConvertTable) { | ||
$config[$locale] += Mage::helper('catalog/product_url')->getConvertTable(); | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters