From dc89796900c48363002fb8254848e7bb79c428b4 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 07 Apr 2016 12:16:59 -0400
Subject: [PATCH] Fixed: Issue #3314 usage of a POST value in autosub validator vauses issues with API

---
 interface/lib/classes/validate_domain.inc.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/validate_domain.inc.php b/interface/lib/classes/validate_domain.inc.php
index 7ca6006..b572467 100644
--- a/interface/lib/classes/validate_domain.inc.php
+++ b/interface/lib/classes/validate_domain.inc.php
@@ -84,7 +84,12 @@
 		global $app;
 		if(empty($field_value) || $field_name != 'subdomain') return; // none set
 
-		$check_domain = $_POST['domain'];
+		if(isset($app->remoting_lib->primary_id)) {
+			$check_domain = $app->remoting_lib->dataRecord['domain'];
+		} else {
+			$check_domain = $_POST['domain'];
+		}
+		
 		$app->uses('ini_parser,getconf');
 		$settings = $app->getconf->get_global_config('domains');
 		if ($settings['use_domain_module'] == 'y') {

--
Gitblit v1.9.1