Silence some php 8.1 warnings (#1029)

This commit is contained in:
FliegenKLATSCH
2022-04-20 15:09:19 +02:00
committed by GitHub
parent 989b4fee0e
commit ae39a1759a
8 changed files with 14 additions and 13 deletions

View File

@@ -260,7 +260,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
$dec_places = Settings::Get('panel.decimal_places'); $dec_places = Settings::Get('panel.decimal_places');
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places); $result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places); $result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
$result['email'] = $idna_convert->decode($result['email']); $result['email'] = $idna_convert->decode($result['email'] ?? '');
$customers_ul = \Froxlor\UI\HTML::makecheckbox('customers_ul', $lng['customer']['unlimited'], '-1', false, $result['customers'], true, true); $customers_ul = \Froxlor\UI\HTML::makecheckbox('customers_ul', $lng['customer']['unlimited'], '-1', false, $result['customers'], true, true);
if ($result['customers'] == '-1') { if ($result['customers'] == '-1') {

View File

@@ -395,7 +395,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
$dec_places = Settings::Get('panel.decimal_places'); $dec_places = Settings::Get('panel.decimal_places');
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places); $result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places); $result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
$result['email'] = $idna_convert->decode($result['email']); $result['email'] = $idna_convert->decode($result['email'] ?? '');
$diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true); $diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true);
if ($result['diskspace'] == '-1') { if ($result['diskspace'] == '-1') {

View File

@@ -674,7 +674,7 @@ if ($page == 'domains' || $page == 'overview') {
function formatDomainEntry(&$row, &$idna_convert) function formatDomainEntry(&$row, &$idna_convert)
{ {
$row['domain'] = $idna_convert->decode($row['domain']); $row['domain'] = $idna_convert->decode($row['domain']);
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']); $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? '');
$row['ipandport'] = ''; $row['ipandport'] = '';
foreach ($row['ipsandports'] as $rowip) { foreach ($row['ipsandports'] as $rowip) {
@@ -685,7 +685,7 @@ function formatDomainEntry(&$row, &$idna_convert)
} }
} }
$row['ipandport'] = substr($row['ipandport'], 0, - 1); $row['ipandport'] = substr($row['ipandport'], 0, - 1);
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? '');
$row['termination_css'] = ""; $row['termination_css'] = "";
if ($row['termination_date'] != "") { if ($row['termination_date'] != "") {

View File

@@ -83,7 +83,7 @@ if ($page == 'overview') {
$statsapp = 'webalizer'; $statsapp = 'webalizer';
} }
$row = [ $row = [
'domain' => $idna_convert->decode($parentdomain) 'domain' => $idna_convert->decode($parentdomain ?? '')
]; ];
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";"); eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";");
@@ -472,8 +472,8 @@ if ($page == 'overview') {
function formatDomainEntry(&$row, &$idna_convert) function formatDomainEntry(&$row, &$idna_convert)
{ {
$row['domain'] = $idna_convert->decode($row['domain']); $row['domain'] = $idna_convert->decode($row['domain']);
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']); $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? '');
$row['domainalias'] = $idna_convert->decode($row['domainalias']); $row['domainalias'] = $idna_convert->decode($row['domainalias'] ?? '');
/** /**
* check for set ssl-certs to show different state-icons * check for set ssl-certs to show different state-icons
@@ -503,7 +503,7 @@ function formatDomainEntry(&$row, &$idna_convert)
} }
} }
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? '');
$row['termination_css'] = ""; $row['termination_css'] = "";
if ($row['termination_date'] != "") { if ($row['termination_date'] != "") {

View File

@@ -472,7 +472,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
// parameters // parameters
$name = $this->getParam('name', true, $result['name']); $name = $this->getParam('name', true, $result['name']);
$idna_convert = new \Froxlor\Idna\IdnaWrapper(); $idna_convert = new \Froxlor\Idna\IdnaWrapper();
$email = $this->getParam('email', true, $idna_convert->decode($result['email'])); $email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? ''));
$password = $this->getParam('admin_password', true, ''); $password = $this->getParam('admin_password', true, '');
$def_language = $this->getParam('def_language', true, $result['def_language']); $def_language = $this->getParam('def_language', true, $result['def_language']);
$custom_notes = $this->getParam('custom_notes', true, $result['custom_notes']); $custom_notes = $this->getParam('custom_notes', true, $result['custom_notes']);

View File

@@ -950,7 +950,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
$move_to_admin = (int) ($this->getParam('move_to_admin', true, 0)); $move_to_admin = (int) ($this->getParam('move_to_admin', true, 0));
$idna_convert = new \Froxlor\Idna\IdnaWrapper(); $idna_convert = new \Froxlor\Idna\IdnaWrapper();
$email = $this->getParam('email', true, $idna_convert->decode($result['email'])); $email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? ''));
$name = $this->getParam('name', true, $result['name']); $name = $this->getParam('name', true, $result['name']);
$firstname = $this->getParam('firstname', true, $result['firstname']); $firstname = $this->getParam('firstname', true, $result['firstname']);
$company_required = empty($result['company']) && ((! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname))); $company_required = empty($result['company']) && ((! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname)));

View File

@@ -63,7 +63,7 @@ class PhpHelper
$subject[$field] = self::htmlentitiesArray($subject[$field], $fields, $quote_style, $charset); $subject[$field] = self::htmlentitiesArray($subject[$field], $fields, $quote_style, $charset);
} }
} }
} else { } elseif (!empty($subject)) {
$subject = htmlentities($subject, $quote_style, $charset); $subject = htmlentities($subject, $quote_style, $charset);
} }

View File

@@ -10,8 +10,9 @@ namespace Froxlor\System;
class IgnorantRecursiveDirectoryIterator extends \RecursiveDirectoryIterator class IgnorantRecursiveDirectoryIterator extends \RecursiveDirectoryIterator
{ {
public function getChildren() #[\ReturnTypeWillChange]
{ public function getChildren()
{
try { try {
return new IgnorantRecursiveDirectoryIterator($this->getPathname()); return new IgnorantRecursiveDirectoryIterator($this->getPathname());
} catch (\UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {