]> git.joonet.de Git - adminer.git/commitdiff
fixed Unsupported operand types when $port is socket
authorDavid Grudl <david@grudl.com>
Tue, 12 Jan 2021 20:32:04 +0000 (21:32 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 7 Feb 2021 08:31:28 +0000 (09:31 +0100)
adminer/include/auth.inc.php
changes.txt

index 964f1d907dc452203111b75859299fc921967798..67a5948459c3e9a6236802412c61b7b329faac56 100644 (file)
@@ -162,7 +162,7 @@ stop_session(true);
 
 if (isset($_GET["username"]) && is_string(get_password())) {
        list($host, $port) = explode(":", SERVER, 2);
-       if (+$port && ($port < 1024 || $port > 65535)) {
+       if (preg_match('~^\s*([-+]?\d+)~', $port, $match) && ($match[1] < 1024 || $match[1] > 65535)) { // is_numeric('80#') would still connect to port 80
                auth_error(lang('Connecting to privileged ports is not allowed.'));
        }
        check_invalid_login();
index 2757183c76e8850863c50fb1cefb0396a524840a..3efc970bb91c804ef20111bccffbb0518ffafa21 100644 (file)
@@ -3,6 +3,7 @@ Fix XSS in browsers which don't encode URL parameters (bug #775, regression from
 Elasticsearch, ClickHouse: Do not print response if HTTP code is not 200
 Don't syntax highlight during IME composition (bug #747)
 MySQL: Do not export names in quotes with sql_mode='ANSI_QUOTES' (bug #749)
+MySQL: Avoid error in PHP 8 when connecting to socket (PR #409)
 PostgreSQL: Export all FKs after all CREATE TABLE (PR #351)
 PostgreSQL: Fix dollar-quoted syntax highlighting (bug #738)
 PostgreSQL: Do not show view definition from other schema (PR #392)