fix validation of system-hostname setting, thx to lando
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -39,5 +39,5 @@ function getFormFieldData($fieldname, $fielddata, &$input)
|
||||
}
|
||||
}
|
||||
|
||||
return $newfieldvalue;
|
||||
return trim($newfieldvalue);
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
|
||||
function checkHostname($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||
{
|
||||
if (0 == strlen(trim($newfieldvalue)))
|
||||
{
|
||||
if (0 == strlen(trim($newfieldvalue))
|
||||
|| validateDomain($newfieldvalue) === false
|
||||
) {
|
||||
return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidhostname');
|
||||
} else {
|
||||
return array(FORMFIELDS_PLAUSIBILITY_CHECK_OK);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* it consists only of the following characters ([a-z0-9][a-z0-9\-]+\.)+[a-z]{2,4}
|
||||
*
|
||||
* @param string The domainname which should be checked.
|
||||
* @return boolean True if the domain is valid, false otherwise
|
||||
* @return string|boolean the domain-name if the domain is valid, false otherwise
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
* @author Michael Duergner
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user