aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/ModelPdo.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-11-06 15:16:00 +0100
committerGravatar GitHub <noreply@github.com> 2019-11-06 15:16:00 +0100
commit22030155f8fd5cab102ddd897a914cf1a0ffd183 (patch)
tree1af332589e778645dc80cb06de8c45261e3eecdd /lib/Minz/ModelPdo.php
parent12cdd2cdf6d493a8bd110d1ae310288a0a47afa0 (diff)
Fix database autocreate at install (#2635)
* Fix database autocreate at install Several bugs prevented the auto-creation of the database in Web and CLI installs. Fix https://github.com/YunoHost-Apps/freshrss_ynh/issues/84#issuecomment-549818408 * initDb https://github.com/FreshRSS/FreshRSS/pull/2635#discussion_r343107795
Diffstat (limited to 'lib/Minz/ModelPdo.php')
-rw-r--r--lib/Minz/ModelPdo.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php
index 69785c253..6eb4881dc 100644
--- a/lib/Minz/ModelPdo.php
+++ b/lib/Minz/ModelPdo.php
@@ -28,6 +28,9 @@ class Minz_ModelPdo {
if ($currentUser === null) {
$currentUser = Minz_Session::param('currentUser');
}
+ if ($currentUser == '') {
+ throw new Minz_PDOConnectionException('Current user must not be empty!', '', Minz_Exception::ERROR);
+ }
if ($currentPdo != null) {
$this->pdo = $currentPdo;
return;
@@ -84,7 +87,6 @@ class Minz_ModelPdo {
'Invalid database type!',
$db['user'], Minz_Exception::ERROR
);
- break;
}
self::$sharedPdo = $this->pdo;
} catch (Exception $e) {