Skip to content

Commit

Permalink
[impr-OpenMage#1091] Allow dash character in store code
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet authored and edannenberg committed Aug 24, 2020
1 parent f5d2be6 commit 590a621
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/code/core/Mage/Core/Model/Resource/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ protected function _initUniqueFields()
*/
protected function _beforeSave(Mage_Core_Model_Abstract $model)
{
if (!preg_match('/^[a-z]+[a-z0-9_]*$/', $model->getCode())) {
if (!preg_match('/^[a-z]+[a-z0-9_\-]*$/', $model->getCode())) {
Mage::throwException(
Mage::helper('core')->__('The store code may contain only letters (a-z), numbers (0-9) or underscore(_), the first character must be a letter'));
Mage::helper('core')->__('The store code may contain only letters (a-z), numbers (0-9), underscore(_) or dash(-), the first character must be a letter')
);
}

return $this;
Expand Down
1 change: 1 addition & 0 deletions app/locale/en_US/Mage_Core_LTS.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"The store code may contain only letters (a-z), numbers (0-9), underscore(_) or dash(-), the first character must be a letter","The store code may contain only letters (a-z), numbers (0-9), underscore(_) or dash(-), the first character must be a letter"

0 comments on commit 590a621

Please sign in to comment.