tighten psalm checks; fix errors

pull/298/head
David Goodwin 5 years ago
parent 034a50836c
commit 34e6f7829e

@ -78,14 +78,12 @@ class PFASmarty {
if (!is_array($data)) {
return htmlentities($data, ENT_QUOTES, 'UTF-8', false);
}
if (is_array($data)) {
$clean = array();
foreach ($data as $key => $value) {
/* as this is a nested data structure it's more likely we'll output the key too (at least in my opinion, so we'll sanitise it too */
$clean[$this->sanitise($key)] = $this->sanitise($value);
}
return $clean;
$clean = array();
foreach ($data as $key => $value) {
/* as this is a nested data structure it's more likely we'll output the key too (at least in my opinion, so we'll sanitise it too */
$clean[$this->sanitise($key)] = $this->sanitise($value);
}
return $clean;
}
}

@ -55,8 +55,6 @@
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />
<RedundantCondition errorLevel="info" />
<DocblockTypeContradiction errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />

@ -317,27 +317,27 @@ if (isset($limit)) {
$gen_show_status_mailbox = array();
$divide_quota = array('current' => array(), 'quota' => array());
if ((is_array($tMailbox) and sizeof($tMailbox) > 0)) {
for ($i = 0; $i < sizeof($tMailbox); $i++) {
$gen_show_status_mailbox [$i] = gen_show_status($tMailbox[$i]['username']);
if (isset($tMailbox[$i]['current'])) {
$divide_quota ['current'][$i] = divide_quota($tMailbox[$i]['current']);
}
if (isset($tMailbox[$i]['quota'])) {
$divide_quota ['quota'][$i] = divide_quota($tMailbox[$i]['quota']);
}
if (isset($tMailbox[$i]['quota']) && isset($tMailbox[$i]['current'])) {
$divide_quota ['percent'][$i] = min(100, round(($divide_quota ['current'][$i]/max(1, $divide_quota ['quota'][$i]))*100));
$divide_quota ['quota_width'][$i] = ($divide_quota ['percent'][$i] / 100 * 120);
} else {
$divide_quota ['current'][$i] = Config::Lang('unknown');
$divide_quota ['quota_width'][$i] = 0; # TODO: use special value?
}
for ($i = 0; $i < sizeof($tMailbox); $i++) {
$gen_show_status_mailbox [$i] = gen_show_status($tMailbox[$i]['username']);
if (isset($tMailbox[$i]['current'])) {
$divide_quota ['current'][$i] = divide_quota($tMailbox[$i]['current']);
}
if (isset($tMailbox[$i]['quota'])) {
$divide_quota ['quota'][$i] = divide_quota($tMailbox[$i]['quota']);
}
if (isset($tMailbox[$i]['quota']) && isset($tMailbox[$i]['current'])) {
$divide_quota ['percent'][$i] = min(100, round(($divide_quota ['current'][$i]/max(1, $divide_quota ['quota'][$i]))*100));
$divide_quota ['quota_width'][$i] = ($divide_quota ['percent'][$i] / 100 * 120);
} else {
$divide_quota ['current'][$i] = Config::Lang('unknown');
$divide_quota ['quota_width'][$i] = 0; # TODO: use special value?
}
}
class cNav_bar {
protected $count;
protected $title;

@ -167,10 +167,7 @@ class PostfixAdmin {
return 1;
}
$command = 'help'; # not the worst default ;-)
if (isset($this->args[0])) {
$command = $this->args[0];
}
$command = $this->args[0];
$this->shellCommand = $command;
$this->shellClass = 'Cli' . ucfirst($command);

Loading…
Cancel
Save