]> git.joonet.de Git - adminer.git/commitdiff
SQLite: Constraint getting view by name to views only
authorJakub Vrana <jakub@vrana.cz>
Wed, 26 Feb 2025 10:04:56 +0000 (11:04 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 26 Feb 2025 11:20:37 +0000 (12:20 +0100)
adminer/drivers/sqlite.inc.php

index d5fb44a7840961d0c1db0f1b8fd088848c069511..5408806af4ed9aa622a042ab6e6160b8f3c7b8d5 100644 (file)
@@ -407,7 +407,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
 
        function view($name) {
                global $connection;
-               return array("select" => preg_replace('~^(?:[^`"[]+|`[^`]*`|"[^"]*")* AS\s+~iU', '', $connection->result("SELECT sql FROM sqlite_master WHERE name = " . q($name)))); //! identifiers may be inside []
+               return array("select" => preg_replace('~^(?:[^`"[]+|`[^`]*`|"[^"]*")* AS\s+~iU', '', $connection->result("SELECT sql FROM sqlite_master WHERE type = 'view' AND name = " . q($name)))); //! identifiers may be inside []
        }
 
        function collations() {