Skip to content

Commit

Permalink
Fix a possible type bug found by phpstan
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Feb 7, 2021
1 parent 61864a3 commit 2772add
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions libraries/classes/ReplicationGui.php
Expand Up @@ -507,15 +507,17 @@ public function handleRequestForSlaveChangeMaster()
/** @var DatabaseInterface $dbi */
global $dbi;

$sr = [];
$_SESSION['replication']['m_username'] = $sr['username']
= $dbi->escapeString($_POST['username']);
$_SESSION['replication']['m_password'] = $sr['pma_pw']
= $dbi->escapeString($_POST['pma_pw']);
$_SESSION['replication']['m_hostname'] = $sr['hostname']
= $dbi->escapeString($_POST['hostname']);
$_SESSION['replication']['m_port'] = $sr['port']
= $dbi->escapeString($_POST['text_port']);
$sr = [
'username' => $dbi->escapeString($_POST['username']),
'pma_pw' => $dbi->escapeString($_POST['pma_pw']),
'hostname' => $dbi->escapeString($_POST['hostname']),
'port' => (int) $dbi->escapeString($_POST['text_port']),
];

$_SESSION['replication']['m_username'] = $sr['username'];
$_SESSION['replication']['m_password'] = $sr['pma_pw'];
$_SESSION['replication']['m_hostname'] = $sr['hostname'];
$_SESSION['replication']['m_port'] = $sr['port'];
$_SESSION['replication']['m_correct'] = '';
$_SESSION['replication']['sr_action_status'] = 'error';
$_SESSION['replication']['sr_action_info'] = __('Unknown error');
Expand Down

0 comments on commit 2772add

Please sign in to comment.