]> git.joonet.de Git - adminer.git/commitdiff
Fix links to PostgreSQL 10 documentation
authorJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 13:02:25 +0000 (14:02 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 13:02:25 +0000 (14:02 +0100)
adminer/include/adminer.inc.php
adminer/include/editing.inc.php

index 82918d003b6912a38cca5fdef6ff6a979e83179a..4afd2c3fb424ddbc7e1dfa9fb02626169e4155b0 100644 (file)
@@ -948,7 +948,7 @@ class Adminer {
                                        }
                                }
                                ?>
-bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');
+bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $connection->server_info) : ""); ?>');
 </script>
 <?php
                        }
index ba14a8aa06d714e6a01d006bc5481a9868bc254d..9a35a5e27c9d64a1b3eab121f9a6ea19288f361b 100644 (file)
@@ -487,10 +487,11 @@ function ini_bytes($ini) {
 */
 function doc_link($paths) {
        global $jush, $connection;
+       $version = preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $connection->server_info);
        $urls = array(
-               'sql' => "https://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/",
+               'sql' => "https://dev.mysql.com/doc/refman/$version/en/",
                'sqlite' => "https://www.sqlite.org/",
-               'pgsql' => "https://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/",
+               'pgsql' => "https://www.postgresql.org/docs/$version/static/",
                'mssql' => "https://msdn.microsoft.com/library/",
                'oracle' => "https://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
        );