]> _ Git - cubist_net.git/commitdiff
wait #7025 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Jul 2024 12:07:46 +0000 (14:07 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Jul 2024 12:07:46 +0000 (14:07 +0200)
src/Transfer/Local.php

index c2bc35554a2b74d9bfb6e2ab62044d41c06a0161..ea8896091a43a3282421dd7d98b8d0f9710f97a8 100644 (file)
@@ -76,25 +76,27 @@ class Local extends Driver
     }
 
     public function checkConnexion($data = []) {
-        $hosting = $data['protocol'] === 'hosting' ? 'hosting.fluidbook.com' : 'hosting2.fluidbook.com';
-        $ipHosting = dns_get_record($hosting, DNS_A)[0]['ip'];
-
-        $subdomains = explode("\r\n",$data['subdomains']);
-        $subdomainsIntruder = [];
-
-        if($subdomains) {
-            foreach($subdomains as $subdomain) {
-                $ipSubdomain = dns_get_record($subdomain, DNS_A)[0]['ip'];
-                $ipSubdomain = trim(str_replace('\n', '', shell_exec('dig +short @1.1.1.1 '.$subdomain.' | tail -1')));
-                if($ipSubdomain !== $ipHosting) {
-                    $subdomainsIntruder[] = $subdomain;
+        if(isset($data['protocol']) && isset($data['subdomains'])) {
+            $hosting = $data['protocol'] === 'hosting' ? 'hosting.fluidbook.com' : 'hosting2.fluidbook.com';
+            $ipHosting = dns_get_record($hosting, DNS_A)[0]['ip'];
+
+            $subdomains = explode("\r\n", $data['subdomains']);
+            $subdomainsIntruder = [];
+
+            if ($subdomains) {
+                foreach ($subdomains as $subdomain) {
+                    $ipSubdomain = dns_get_record($subdomain, DNS_A)[0]['ip'];
+                    $ipSubdomain = trim(str_replace('\n', '', shell_exec('dig +short @1.1.1.1 ' . $subdomain . ' | tail -1')));
+                    if ($ipSubdomain !== $ipHosting) {
+                        $subdomainsIntruder[] = $subdomain;
+                    }
                 }
             }
-        }
 
-        if($subdomainsIntruder) {
-            $subdomainsList = implode(", ",$subdomainsIntruder);
-            return ['subdomains' => $subdomainsList, 'host' => $hosting];
+            if ($subdomainsIntruder) {
+                $subdomainsList = implode(", ", $subdomainsIntruder);
+                return ['subdomains' => $subdomainsList, 'host' => $hosting];
+            }
         }
 
         if(file_exists($this->getRootPath().'status')) {