@@ -27,26 +27,26 @@ class Text extends \Magento\Eav\Model\Attribute\Data\AbstractData
27
27
/**
28
28
* @var array
29
29
*/
30
- private $ encodeAttributesByTypesList ;
30
+ private $ allowDiacriticsForAttributes ;
31
31
32
32
/**
33
33
* @param TimezoneInterface $localeDate
34
34
* @param LoggerInterface $logger
35
35
* @param ResolverInterface $localeResolver
36
36
* @param StringUtils $stringHelper
37
- * @param array $encodeAttributesByTypesList
37
+ * @param array $allowDiacriticsForAttributes
38
38
* @codeCoverageIgnore
39
39
*/
40
40
public function __construct (
41
41
\Magento \Framework \Stdlib \DateTime \TimezoneInterface $ localeDate ,
42
42
\Psr \Log \LoggerInterface $ logger ,
43
43
\Magento \Framework \Locale \ResolverInterface $ localeResolver ,
44
44
\Magento \Framework \Stdlib \StringUtils $ stringHelper ,
45
- array $ encodeAttributesByTypesList = []
45
+ array $ allowDiacriticsForAttributes = []
46
46
) {
47
47
parent ::__construct ($ localeDate , $ logger , $ localeResolver );
48
48
$ this ->_string = $ stringHelper ;
49
- $ this ->encodeAttributesByTypesList = $ encodeAttributesByTypesList ;
49
+ $ this ->allowDiacriticsForAttributes = $ allowDiacriticsForAttributes ;
50
50
}
51
51
52
52
/**
@@ -91,7 +91,11 @@ public function validateValue($value)
91
91
return $ errors ;
92
92
}
93
93
94
- if (in_array ($ attribute ->getAttributeCode (), $ this ->encodeAttributesByTypesList [$ attribute ->getEntityType ()->getEntityTypeCode ()])) {
94
+ if (isset ($ this ->allowDiacriticsForAttributes [$ this ->getAttribute ()->getEntityType ()->getEntityTypeCode ()])
95
+ && in_array (
96
+ $ this ->getAttribute ()->getAttributeCode (),
97
+ $ this ->allowDiacriticsForAttributes [$ this ->getAttribute ()->getEntityType ()->getEntityTypeCode ()]
98
+ )) {
95
99
// if string with diacritics encode it.
96
100
$ value = $ this ->encodeDiacritics ($ value );
97
101
}
0 commit comments