Bläddra i källkod

fix config dir creation on invalid subdomain

Olivier Massot 3 år sedan
förälder
incheckning
d1472670f2
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      ot_admin/Classes/Controller/SiteController.php

+ 2 - 2
ot_admin/Classes/Controller/SiteController.php

@@ -1788,7 +1788,7 @@ class SiteController extends ActionController
                     continue;
                 }
 
-                $identifier = $website['subdomain'] . '_' . $website['organization_id'];
+                $identifier = str_replace('/', '', $website['subdomain']) . '_' . $website['organization_id'];
                 $configDir = $configRootDir . $identifier;
                 $configFilename = $configDir . "/config.yaml";
 
@@ -1800,7 +1800,7 @@ class SiteController extends ActionController
 
                 try {
                     $this->mkDir($configDir);
-                } catch (\Exception $e) {
+                } catch (\Throwable $e) {
                     throw new RuntimeException('Unable to create the directory ' . $configDir, 0, $e);
                 }
                 $this->writeFile($configFilename, $yamlConfig);