1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Warn when using password with leading or trailing spaces

This commit is contained in:
Jakub Vrana
2018-09-13 16:08:57 +02:00
parent a5cbad504c
commit 0f08592bc0
4 changed files with 5 additions and 1 deletions

View File

@@ -172,7 +172,8 @@ if (isset($_GET["username"])) {
$login = null;
if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) {
auth_error((is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.'))));
$error = (is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.')));
auth_error($error . (preg_match('~^ | $~', get_password()) ? '<br>' . lang('There is a space in the input password which might be the cause.') : ''));
}
if ($auth && $_POST["token"]) {