From 7232271a379396ca1d4b083af051262057003c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 27 Mar 2017 15:55:35 +0200 Subject: [PATCH] Truncate only long passwords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids problems with certain PHP versions returning false when first parameter to substr is ''. Signed-off-by: Michal Čihař --- libraries/common.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 4922999b91..1a3782eee8 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -639,7 +639,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { . ' ' . $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); } $fqnAuthClass = 'PMA\libraries\plugins\auth\\' . $auth_class;