If the name starts with a ., strip it

This commit is contained in:
Mark Schouten 2014-06-03 09:27:54 +02:00
parent 32e49eae99
commit 9854630f68

View file

@ -237,6 +237,7 @@ if ($action == "list" or $action== "listslaves") {
} elseif ($action == "createrecord" or $action == "editrecord") {
$name = (!preg_match("/\.".$_POST['domain']."\.?$/", $_POST['name'])) ? $_POST['name'].'.'.$_POST['domain'] : $_POST['name'];
$name = preg_replace("/\.$/", "", $name);
$name = preg_replace("/^\./", "", $name);
$records = array();
if ($action == "createrecord") {
$records = getrecords_by_name_type($_GET['zoneurl'], $name, $_POST['type']);