bernd commited on 2010-12-15 06:43:43
Zeige 2 geänderte Dateien mit 5 Einfügungen und 3 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1849 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -78,7 +78,9 @@ function filter_input_hostname( $input, $wildcard=false ) |
| 78 | 78 |
$input = ltrim($input, "\t\n\r\x00 ."); |
| 79 | 79 |
if (preg_replace("/[^[:alnum:]äöü*\.\-]/", "", $input ) != $input)
|
| 80 | 80 |
system_failure("Ihre Daten enthielten ungültige Zeichen!");
|
| 81 |
- if (! $wildcard && preg_replace("/\*/", "", $input ) != $input)
|
|
| 81 |
+ if (preg_match("/^.+\*/", $input ))
|
|
| 82 |
+ system_failure("Ihre Daten enthielten ungültige Zeichen (Wildcard-Stern muss ganz vorne stehen)!");
|
|
| 83 |
+ if (! $wildcard && preg_replace("/^\*/", "", $input ) != $input)
|
|
| 82 | 84 |
system_failure("Ihre Daten enthielten ungültige Zeichen (Keine Wildcards erlaubt)!");
|
| 83 | 85 |
if (strstr($input, '..')) |
| 84 | 86 |
system_failure("Ungültiger Hostname");
|
| ... | ... |
@@ -22,7 +22,7 @@ if ($_GET['action'] == 'edit') |
| 22 | 22 |
$vhost = get_vhost_details( $id ); |
| 23 | 23 |
DEBUG($vhost); |
| 24 | 24 |
|
| 25 |
- $hostname = filter_input_hostname($_POST['hostname']); |
|
| 25 |
+ $hostname = filter_input_hostname($_POST['hostname'], true); |
|
| 26 | 26 |
|
| 27 | 27 |
$domain_id = (int) $_POST['domain']; |
| 28 | 28 |
if ($domain_id != -1) {
|
| ... | ... |
@@ -201,7 +201,7 @@ elseif ($_GET['action'] == 'addalias') |
| 201 | 201 |
$alias['vhost'] = $vhost['id']; |
| 202 | 202 |
|
| 203 | 203 |
|
| 204 |
- $hostname = filter_input_hostname($_POST['hostname']); |
|
| 204 |
+ $hostname = filter_input_hostname($_POST['hostname'], true); |
|
| 205 | 205 |
$domainid = (int) $_POST['domain']; |
| 206 | 206 |
if ($domainid != -1) {
|
| 207 | 207 |
$domain = new Domain( (int) $_POST['domain'] ); |
| 208 | 208 |