[Install] Filter Directory name

pull/1098/head
Peter Goodhall 2021-07-20 18:53:53 +01:00
rodzic b281e9c62e
commit e424ddbfda
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ class Core {
$counter = 0; $counter = 0;
// Validate the hostname // Validate the hostname
if(isset($data['hostname']) AND !empty($data['hostname'])) { if(isset($data['hostname']) AND !empty($data['hostname']) AND filter_var($data['hostname'], FILTER_SANITIZE_URL)) {
$counter++; $counter++;
} }
// Validate the username // Validate the username
@ -25,8 +25,14 @@ class Core {
$counter++; $counter++;
} }
if(!preg_match("~0-9A-Za-z-/+~", $data['directory'])) {
// pass
} else {
return false;
}
// Check if all the required fields have been entered // Check if all the required fields have been entered
if($counter == '3') { if($counter == '4') {
return true; return true;
} }
else { else {