Pārlūkot izejas kodu

fixed empty host

develop
Robin Thoni 9 gadus atpakaļ
vecāks
revīzija
e7c82b333b
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2
    1
      src/DBO/Actions/ActionAddHost.cpp

+ 2
- 1
src/DBO/Actions/ActionAddHost.cpp Parādīt failu

@@ -27,8 +27,9 @@ ActionAddHost::ActionAddHost()
27 27
 
28 28
 const std::string ActionAddHost::getSql() const
29 29
 {
30
+    auto host = _host.empty() ? _domain : _host + "." + _domain;
30 31
     auto query = "INSERT INTO records (domain_id, name, type, content, ttl, prio, change_date)\n"
31
-            "    VALUES(@domain_id, \"" + _host + "." + _domain + "\", \"" + _recordType + "\","
32
+            "    VALUES(@domain_id, \"" + host + "\", \"" + _recordType + "\","
32 33
             " \"" + _recordValue + "\", 84600, 0, " + std::to_string(time(nullptr)) + ");\n";
33 34
 
34 35
     if (_reverseEnabled && _recordType == "A")

Notiek ielāde…
Atcelt
Saglabāt