From 15b96b9cb8bd335d37df57bf794bfa2cd1fefa6d Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sat, 15 Feb 2014 09:10:49 -0500
Subject: [PATCH] Fixed: FS#3131 - Wrong Apache setting for Subdomain (vhost) without hostname

---
 interface/web/sites/web_vhost_subdomain_edit.php |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/interface/web/sites/web_vhost_subdomain_edit.php b/interface/web/sites/web_vhost_subdomain_edit.php
index 560079d..1e27593 100644
--- a/interface/web/sites/web_vhost_subdomain_edit.php
+++ b/interface/web/sites/web_vhost_subdomain_edit.php
@@ -348,6 +348,11 @@
 
 		if($app->tform->getCurrentTab() == 'domain') {
 
+			// Check that domain (the subdomain part) is not empty
+			if(!preg_match('/^[a-zA-Z0-9].+/',$this->dataRecord['domain'])) {
+				$app->tform->errorMessage .= $app->tform->lng("subdomain_error_empty")."<br />";
+			}
+			
 			/* check if the domain module is used - and check if the selected domain can be used! */
 			$app->uses('ini_parser,getconf');
 			$settings = $app->getconf->get_global_config('domains');

--
Gitblit v1.9.1