diff --git a/vendor/magento/module-company/Model/SaveValidator/SanitizeRegion.php b/vendor/magento/module-company/Model/SaveValidator/SanitizeRegion.php new file mode 100644 index 000000000000..4592ab614d06 --- /dev/null +++ b/vendor/magento/module-company/Model/SaveValidator/SanitizeRegion.php @@ -0,0 +1,53 @@ +company->getRegion(); + if (empty($region)) { + return; + } + + $sanitized = trim($this->stripTags->filter($region)); + $this->company->setRegion($sanitized); + } +} diff --git a/vendor/magento/module-company/Ui/Component/Form/Field/Company/Options.php b/vendor/magento/module-company/Ui/Component/Form/Field/Company/Options.php index 51abde37a55d..e884e112e6c0 100644 --- a/vendor/magento/module-company/Ui/Component/Form/Field/Company/Options.php +++ b/vendor/magento/module-company/Ui/Component/Form/Field/Company/Options.php @@ -106,7 +106,8 @@ private function formatItems(array $searchResult): array return [ 'label' => $company->getCompanyName(), 'value' => $company->getId(), - 'text' => sprintf('%s, %s', $company->getCountryId(), $region) + 'text' => sprintf('%s, %s', $company->getCountryId(), $region), + '__disableTmpl' => true ]; }, $searchResult); } diff --git a/vendor/magento/module-company/etc/di.xml b/vendor/magento/module-company/etc/di.xml index fc9922cba5a3..07fac4b356a5 100644 --- a/vendor/magento/module-company/etc/di.xml +++ b/vendor/magento/module-company/etc/di.xml @@ -48,6 +48,7 @@ \Magento\Company\Model\SaveValidator\CompanyId \Magento\Company\Model\SaveValidator\RequiredFields \Magento\Company\Model\SaveValidator\SanitizeCompanyName + \Magento\Company\Model\SaveValidator\SanitizeRegion \Magento\Company\Model\SaveValidator\SalesRepresentative \Magento\Company\Model\SaveValidator\CustomerGroup \Magento\Company\Model\SaveValidator\CompanyStatus