]> git.nbdom.net Git - nb.git/commitdiff
bug when db unknow
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 Jan 2017 14:05:00 +0000 (14:05 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 Jan 2017 14:05:00 +0000 (14:05 +0000)
www/dbq/dbq.php

index 8c4825a46588795b02e41a3881d981def7fa8d11..b99ade49afb54618097ed1d71af93e203ec241d8 100644 (file)
@@ -195,13 +195,13 @@ class DbQ extends nb {
       # From conf
       if (!is_array($connect)
         and $connect === true
-        and isset($this->db->conf[$this->params['db']])
       ) {
+        if (empty($this->db->conf[$this->params['db']]))
+          $this->not_found('Unknown database: '.$this->params['db']);
         $connect = $this->db->conf[$this->params['db']];
-        if (empty($connect['name'])) $this->not_found('Unknown database: '.$this->params['db']);
       }
 
-      $connect['id']= $this->params['db'];
+      $connect['id'] = $this->params['db'];
 
       $this->db->__construct($connect);
       #$this->id = $this->params['db'];