Files
Froxlor/lib/functions/validate/function.checkHostname.php
Michael Kaufmann (d00p) 74b71bb926 fix validation of system-hostname setting, thx to lando
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2014-06-07 15:04:51 +02:00

28 lines
827 B
PHP

<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
*
*/
function checkHostname($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
{
if (0 == strlen(trim($newfieldvalue))
|| validateDomain($newfieldvalue) === false
) {
return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidhostname');
} else {
return array(FORMFIELDS_PLAUSIBILITY_CHECK_OK);
}
}