Avoid problems with PHP comparison

- allow password where empty returns true
- compare using ===

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-08-17 13:18:45 +02:00
parent 311be7515c
commit 76a471a790

View File

@ -112,10 +112,10 @@ function PMA_setChangePasswordMsg()
$message = PMA\libraries\Message::success(__('The profile has been updated.'));
if (($_REQUEST['nopass'] != '1')) {
if (empty($_REQUEST['pma_pw']) || empty($_REQUEST['pma_pw2'])) {
if (strlen($_REQUEST['pma_pw']) === 0 || strlen($_REQUEST['pma_pw2']) === 0) {
$message = PMA\libraries\Message::error(__('The password is empty!'));
$error = true;
} elseif ($_REQUEST['pma_pw'] != $_REQUEST['pma_pw2']) {
} elseif ($_REQUEST['pma_pw'] !== $_REQUEST['pma_pw2']) {
$message = PMA\libraries\Message::error(
__('The passwords aren\'t the same!')
);