]> git.joonet.de Git - adminer.git/commitdiff
Fix the uncaught exception because of namespace.
authorTakashi SHIRAI <shirai@nintendo.co.jp>
Wed, 19 Mar 2025 06:23:02 +0000 (15:23 +0900)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Mar 2025 17:35:32 +0000 (18:35 +0100)
Signed-off-by: Takashi SHIRAI <shirai@nintendo.co.jp>
adminer/drivers/sqlite.inc.php
adminer/include/pdo.inc.php
plugins/drivers/mongo.php

index 5d64a3bee68e6aa8b87615abbdd7461bcc01ac87..a4352150c3bf0532306450d3a1c30b9842bbf09b 100644 (file)
@@ -393,7 +393,7 @@ if (isset($_GET["sqlite"])) {
                }
                try {
                        $link = new SqliteDb($db);
-               } catch (Exception $ex) {
+               } catch (\Exception $ex) {
                        $connection->error = $ex->getMessage();
                        return false;
                }
index 51171cc192161bcba15c454f73d680fadc4604b3..6cda3ae0e87d2c79adbccb0fa624ac416ccbed52 100644 (file)
@@ -13,7 +13,7 @@ if (extension_loaded('pdo')) {
                        $options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoDbStatement');
                        try {
                                $this->pdo = new \PDO($dsn, $username, $password, $options);
-                       } catch (Exception $ex) {
+                       } catch (\Exception $ex) {
                                auth_error(h($ex->getMessage()));
                        }
                        $this->server_info = @$this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION);
index ac29c2263e559fe61ec3219aa8c5d2233298712b..8d9d8d8d990f058739e3715246139bcd3e7b9e28 100644 (file)
@@ -25,7 +25,7 @@ if (isset($_GET["mongo"])) {
                        function executeDbCommand($db, $command) {
                                try {
                                        return $this->_link->executeCommand($db, new \MongoDB\Driver\Command($command));
-                               } catch (Exception $e) {
+                               } catch (\Exception $e) {
                                        $this->error = $e->getMessage();
                                        return array();
                                }
@@ -36,7 +36,7 @@ if (isset($_GET["mongo"])) {
                                        $results = $this->_link->executeBulkWrite($namespace, $bulk);
                                        $this->affected_rows = $results->$counter();
                                        return true;
-                               } catch (Exception $e) {
+                               } catch (\Exception $e) {
                                        $this->error = $e->getMessage();
                                        return false;
                                }
@@ -331,7 +331,7 @@ if (isset($_GET["mongo"])) {
                        $skip = $page * $limit;
                        try {
                                return new Result($this->conn->_link->executeQuery($this->conn->_db_name . ".$table", new \MongoDB\Driver\Query($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort))));
-                       } catch (Exception $e) {
+                       } catch (\Exception $e) {
                                $this->conn->error = $e->getMessage();
                                return false;
                        }