浏览代码

fix config dir creation on invalid subdomain

Olivier Massot 3 年之前
父节点
当前提交
d1472670f2
共有 1 个文件被更改,包括 2 次插入2 次删除
  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);