Skip to content

Commit

Permalink
Truncate only long passwords
Browse files Browse the repository at this point in the history
This avoids problems with certain PHP versions returning false when
first parameter to substr is ''.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Mar 27, 2017
1 parent 1f859b1 commit b6ca92c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/common.inc.php
Expand Up @@ -868,7 +868,7 @@
. ' ' . $cfg['Server']['auth_type']
);
}
if (isset($_REQUEST['pma_password'])) {
if (isset($_REQUEST['pma_password']) && strlen($_REQUEST['pma_password']) > 256) {
$_REQUEST['pma_password'] = substr($_REQUEST['pma_password'], 0, 256);
}
include_once './libraries/plugins/auth/' . $auth_class . '.class.php';
Expand Down

0 comments on commit b6ca92c

Please sign in to comment.