Skip to content

Commit ca9eb60

Browse files
committed
MC-40538: When entering example.com/0 into browser the homepage is shown (example.com)
1 parent 95819f2 commit ca9eb60

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

app/code/Magento/Store/Model/Validation/StoreCodeValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public function isValid($value)
4141
),
4242
\Zend_Validate_Regex::NOT_MATCH
4343
);
44+
$result = $validator->isValid($value);
45+
$this->_messages = $validator->getMessages();
4446

45-
return $validator->isValid($value);
47+
return $result;
4648
}
4749
}

app/code/Magento/Store/Model/Validation/StoreNameValidator.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ public function __construct(NotEmptyFactory $notEmptyValidatorFactory)
3434
public function isValid($value)
3535
{
3636
$validator = $this->notEmptyValidatorFactory->create(['options' => []]);
37-
$validator->setMessage(__('Name is required'), \Zend_Validate_NotEmpty::IS_EMPTY);
37+
$validator->setMessage(
38+
__('Name is required'),
39+
\Zend_Validate_NotEmpty::IS_EMPTY
40+
);
41+
$result = $validator->isValid($value);
42+
$this->_messages = $validator->getMessages();
3843

39-
return $validator->isValid($value);
44+
return $result;
4045
}
4146
}

app/code/Magento/Store/Model/Validation/StoreValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public function isValid($value)
4444
foreach ($this->rules as $fieldName => $rule) {
4545
$validator->addRule($rule, $fieldName);
4646
}
47+
$result = $validator->isValid($value);
48+
$this->_messages = $validator->getMessages();
4749

48-
return $validator->isValid($value);
50+
return $result;
4951
}
5052
}

0 commit comments

Comments
 (0)