Skip to content
Snippets Groups Projects

ISTWCMS-7044 Add checking for '//' to manual URL validation

@@ -237,6 +237,12 @@ function _uw_cfg_common_alias_validate(array &$element, FormStateInterface $form
return;
}
// Check if url has '//'.
if (str_contains($url, '//')) {
$form_state->setError($element['alias'], t('The URL must not contain multiple consecutive forward slashes.'));
return;
}
// This is for editing an existing node.
if ($element['source']['#value'] !== NULL) {
// Get the url which is saved from '/node/{id}'.
Loading