Skip to content

Commit

Permalink
get rid of most of the checkstyle warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Dec 24, 2018
1 parent 30f5902 commit 7416a41
Show file tree
Hide file tree
Showing 41 changed files with 129 additions and 119 deletions.
8 changes: 4 additions & 4 deletions admin_admins.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
$traffic_percent = 100;
}

$row = \Froxlor\PhpHelper::str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);

$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';

Expand Down Expand Up @@ -174,7 +174,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_admin_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_admin_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -327,7 +327,7 @@
$ipaddress .= \Froxlor\UI\HTML::makeoption($row['ip'], $row['id'], $result['ip']);
}

$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

$admin_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/admin/formfield.admin_edit.php';
$admin_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($admin_edit_data);
Expand Down
2 changes: 1 addition & 1 deletion admin_autoupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
'page' => 'error',
'errno' => 3
));
} elseif (\Froxlor\Froxlor::version_compare2($version, $_version) == - 1) {
} elseif (\Froxlor\Froxlor::versionCompare2($version, $_version) == - 1) {
// there is a newer version - yay
$isnewerversion = 1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion admin_cronjobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$cmod = $row['module'];
}
if ($paging->checkDisplay($i)) {
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);

$row['lastrun'] = date('d.m.Y H:i', $row['lastrun']);
$row['isactive'] = ((int) $row['isactive'] == 1) ? $lng['panel']['yes'] : $lng['panel']['no'];
Expand Down
10 changes: 5 additions & 5 deletions admin_customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@
$islocked = 1;
}

$row = \Froxlor\PhpHelper::str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);

// fix progress-bars if value is >100%
if ($disk_percent > 100) {
Expand Down Expand Up @@ -230,7 +230,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('customer_reallyunlock', $filename, array(
\Froxlor\UI\HTML::askYesNo('customer_reallyunlock', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -260,7 +260,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno_withcheckbox('admin_customer_reallydelete', 'admin_customer_alsoremovefiles', $filename, array(
\Froxlor\UI\HTML::askYesNoWithCheckbox('admin_customer_reallydelete', 'admin_customer_alsoremovefiles', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -438,7 +438,7 @@
$result['mysqls'] = '';
}

$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

$gender_options = \Froxlor\UI\HTML::makeoption($lng['gender']['undef'], 0, ($result['gender'] == '0' ? true : false), true, true);
$gender_options .= \Froxlor\UI\HTML::makeoption($lng['gender']['male'], 1, ($result['gender'] == '1' ? true : false), true, true);
Expand Down
6 changes: 3 additions & 3 deletions admin_domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

if (isset($row['domain']) && $row['domain'] != '' && $paging->checkDisplay($i)) {
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
// display a nice list of IP's
$row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']);
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
Expand Down Expand Up @@ -159,7 +159,7 @@
if (\Froxlor\Domain\Domain::domainHasMainSubDomains($id)) {
$showcheck = true;
}
\Froxlor\UI\HTML::ask_yesno_withcheckbox('admin_domain_reallydelete', 'remove_subbutmain_domains', $filename, array(
\Froxlor\UI\HTML::askYesNoWithCheckbox('admin_domain_reallydelete', 'remove_subbutmain_domains', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -624,7 +624,7 @@
}
}

$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

$domain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_edit.php';
$domain_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($domain_edit_data);
Expand Down
2 changes: 1 addition & 1 deletion admin_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $dec_places);
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $dec_places);
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places);
$userinfo = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');

$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';

Expand Down
6 changes: 3 additions & 3 deletions admin_ipsandports.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {

if ($paging->checkDisplay($i)) {
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$row['ip'] = '[' . $row['ip'] . ']';
}
Expand Down Expand Up @@ -94,7 +94,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_ip_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_ip_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -146,7 +146,7 @@
));
} else {

$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

$ipsandports_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php';
$ipsandports_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ipsandports_edit_data);
Expand Down
4 changes: 2 additions & 2 deletions admin_logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
$_action = 0;
foreach ($logrows as $row) {
// if ($paging->checkDisplay($i)) {
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
$row['date'] = date("d.m.y H:i:s", $row['date']);

if ($_action != $action) {
Expand Down Expand Up @@ -122,7 +122,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('logger_reallytruncate', $filename, array(
\Froxlor\UI\HTML::askYesNo('logger_reallytruncate', $filename, array(
'page' => $page,
'action' => $action
), TABLE_PANEL_LOG);
Expand Down
4 changes: 2 additions & 2 deletions admin_phpsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('phpsetting_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('phpsetting_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -279,7 +279,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('fpmsetting_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('fpmsetting_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down
6 changes: 3 additions & 3 deletions admin_plans.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {

if ($paging->checkDisplay($i)) {
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
$row['ts_format'] = date("d.m.Y H:i", $row['ts']);
eval("\$plans.=\"" . \Froxlor\UI\Template::getTemplate("plans/plans_plan") . "\";");
$count ++;
Expand Down Expand Up @@ -90,7 +90,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('plan_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('plan_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -271,7 +271,7 @@
if ($result['name'] != '') {

$result['value'] = json_decode($result['value'], true);
$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

foreach ($result['value'] as $index => $value) {
$result[$index] = $value;
Expand Down
12 changes: 6 additions & 6 deletions admin_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
'filename' => 'admin_index.php'
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_configs_reallyrebuild', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_configs_reallyrebuild', $filename, array(
'page' => $page
));
}
Expand All @@ -179,7 +179,7 @@

eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/updatecounters") . "\";");
} else {
\Froxlor\UI\HTML::ask_yesno('admin_counters_reallyupdate', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_counters_reallyupdate', $filename, array(
'page' => $page
));
}
Expand All @@ -194,7 +194,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_cleartextmailpws_reallywipe', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_cleartextmailpws_reallywipe', $filename, array(
'page' => $page
));
}
Expand All @@ -211,7 +211,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_quotas_reallywipe', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_quotas_reallywipe', $filename, array(
'page' => $page
));
}
Expand Down Expand Up @@ -252,7 +252,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_quotas_reallyenforce', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_quotas_reallyenforce', $filename, array(
'page' => $page
));
}
Expand All @@ -261,7 +261,7 @@
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$integrity->fixAll();
} elseif (isset($_GET['action']) && $_GET['action'] == "fix") {
\Froxlor\UI\HTML::ask_yesno('admin_integritycheck_reallyfix', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_integritycheck_reallyfix', $filename, array(
'page' => $page
));
}
Expand Down
10 changes: 5 additions & 5 deletions admin_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_template_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_template_reallydelete', $filename, array(
'subjectid' => $subjectid,
'mailbodyid' => $mailbodyid,
'page' => $page,
Expand Down Expand Up @@ -190,7 +190,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('admin_template_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('admin_template_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -426,7 +426,7 @@
));
} else {

$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
$template = $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])];
$subject = $result['value'];
$result_stmt = Database::prepare("
Expand All @@ -442,7 +442,7 @@

// don't escape the already escaped language-string so save up before htmlentities()
$language = $result['language'];
$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
$mailbody = $result['value'];

$template_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_edit.php';
Expand Down Expand Up @@ -487,7 +487,7 @@
's' => $s
));
} else {
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);

$filetemplate_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
$filetemplate_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_edit_data);
Expand Down
4 changes: 2 additions & 2 deletions admin_traffic.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
));

while ($traffic_month = $traffic_list_stmt->fetch(PDO::FETCH_ASSOC)) {
$virtual_host[$months[(int) $traffic_month['month']]] = \Froxlor\PhpHelper::size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$virtual_host[$months[(int) $traffic_month['month']]] = \Froxlor\PhpHelper::sizeReadable($traffic_month['traffic'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$totals[$months[(int) $traffic_month['month']]] += $traffic_month['traffic'];
}
eval("\$domain_list .= sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");");
Expand All @@ -125,7 +125,7 @@
'name' => $lng['traffic']['months']['total']
);
foreach ($totals as $month => $bytes) {
$virtual_host[$month] = ($bytes == 0 ? '-' : \Froxlor\PhpHelper::size_readable($bytes, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s'));
$virtual_host[$month] = ($bytes == 0 ? '-' : \Froxlor\PhpHelper::sizeReadable($bytes, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s'));
}
$customerview = 0;
eval("\$total_list = sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");");
Expand Down
2 changes: 1 addition & 1 deletion api_keys.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
}

// escape stuff
$row = \Froxlor\PhpHelper::htmlentities_array($key);
$row = \Froxlor\PhpHelper::htmlentitiesArray($key);

// shorten keys
$row['_apikey'] = substr($row['apikey'], 0, 20) . '...';
Expand Down
10 changes: 5 additions & 5 deletions customer_domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
if ($paging->checkDisplay($i)) {

if (isset($domain_array[$sortkey])) {
$row = \Froxlor\PhpHelper::htmlentities_array($domain_array[$sortkey]);
$row = \Froxlor\PhpHelper::htmlentitiesArray($domain_array[$sortkey]);
if (Settings::Get('system.awstats_enabled') == '1') {
$statsapp = 'awstats';
} else {
Expand All @@ -176,7 +176,7 @@
if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) {
$show_ssledit = true;
}
$row = \Froxlor\PhpHelper::htmlentities_array($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@
's' => $s
));
} else {
\Froxlor\UI\HTML::ask_yesno('domains_reallydelete', $filename, array(
\Froxlor\UI\HTML::askYesNo('domains_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
Expand Down Expand Up @@ -459,7 +459,7 @@
}

$domainip = $result_ipandport['ip'];
$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

$subdomain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domains_edit.php';
$subdomain_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($subdomain_edit_data);
Expand Down Expand Up @@ -512,7 +512,7 @@
$do_insert = true;
}

$result = \Froxlor\PhpHelper::htmlentities_array($result);
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);

$ssleditor_data = include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domain_ssleditor.php';
$ssleditor_form = \Froxlor\UI\HtmlForm::genHTMLForm($ssleditor_data);
Expand Down
Loading

0 comments on commit 7416a41

Please sign in to comment.