Skip to content

Commit 079bb15

Browse files
committed
Using the same regex rule as it is in attribute code validator
1 parent 8129886 commit 079bb15

File tree

1 file changed

+1
-1
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function execute()
212212
}
213213

214214
$validatorAttrCode = new \Zend_Validate_Regex(
215-
['pattern' => '/^[a-zA-Z]+[a-zA-Z0-9_]+$/u']
215+
['pattern' => '/^[a-zA-Z]+[a-zA-Z0-9_]*$/u']
216216
);
217217
if (!$validatorAttrCode->isValid($attributeCode)) {
218218
$this->messageManager->addErrorMessage(

0 commit comments

Comments
 (0)