浏览代码

Update Core\DB

Visman 3 年之前
父节点
当前提交
8418606d83
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/Core/DB.php

+ 4 - 0
app/Core/DB.php

@@ -108,6 +108,10 @@ class DB
     {
         $dsn = $this->initialConfig($dsn);
 
+        if (\preg_match('%[^\w]%', $prefix)) {
+            throw new PDOException("Bad prefix");
+        }
+
         $this->dbPrefix = $prefix;
 
         list($initSQLCommands, $initFunction) = $this->prepareOptions($options);