fixing PHP warnings

This commit is contained in:
Jokob-sk
2022-12-24 21:57:43 +11:00
parent da3ac55122
commit 0714aea30d
17 changed files with 213 additions and 79 deletions

View File

@@ -13,7 +13,7 @@
<!-- &copy; 2020 Puche -->
<?php
echo '<span style="display:inline-block; transform: rotate(180deg)">&copy;</span> 2020 Puche (+2022 jokob-sk)';
echo '<span style="display:inline-block; transform: rotate(180deg)">&copy;</span> 2020 Puche (2022+ jokob-sk)';
?>
<!-- To the right -->
<div class="pull-right no-hidden-xs">

View File

@@ -20,12 +20,8 @@ $log_file = "pialert_front.log";
$fullConfPath = $configFolderPath.$config_file;
chmod($fullConfPath, 0777);
$config_file_lines = file($fullConfPath);
$config_file_lines_timezone = array_values(preg_grep('/^TIMEZONE\s.*/', $config_file_lines));
$timezone_line = explode("'", $config_file_lines_timezone[0]);
$Pia_TimeZone = $timezone_line[1];
$timeZone = "";
@@ -63,12 +59,12 @@ if (file_exists('../db/setting_darkmode')) {
foreach (glob("../db/setting_skin*") as $filename) {
$pia_skin_selected = str_replace('setting_','',basename($filename));
}
if (strlen($pia_skin_selected) == 0) {$pia_skin_selected = 'skin-blue';}
if (isset($pia_skin_selected) == FALSE or (strlen($pia_skin_selected) == 0)) {$pia_skin_selected = 'skin-blue';}
foreach (glob("../db/setting_language*") as $filename) {
$pia_lang_selected = str_replace('setting_language_','',basename($filename));
}
if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';}
if (isset($pia_lang_selected) == FALSE or (strlen($pia_lang_selected) == 0)) {$pia_lang_selected = 'en_us';}
require 'php/templates/language/'.$pia_lang_selected.'.php';
// ###################################
// ## GUI settings processing end

View File

@@ -474,7 +474,7 @@ $pia_lang['REPORT_WEBHOOK_description'] = 'Enable webhooks for notifications. If
$pia_lang['WEBHOOK_URL_name'] = 'Target URL';
$pia_lang['WEBHOOK_URL_description'] = 'Target URL starting with <code>http://</code> or <code>https://</code>.';
$pia_lang['WEBHOOK_PAYLOAD_name'] = 'Payload type';
$pia_lang['WEBHOOK_PAYLOAD_description'] = 'The Webhook payload data format for the "body > attachements > text" attribute in the payload json. See an examnple of the payload <a target="_blank" href="https://github.com/jokob-sk/Pi.Alert/blob/main/docs/webhook_json_sample.json">here</a>. (e.g.: for discord use <code>\'html\'</code>)';
$pia_lang['WEBHOOK_PAYLOAD_description'] = 'The Webhook payload data format for the "body > attachements > text" attribute in the payload json. See an example of the payload <a target="_blank" href="https://github.com/jokob-sk/Pi.Alert/blob/main/docs/webhook_json_sample.json">here</a>. (e.g.: for discord use <code>\'html\'</code>)';
$pia_lang['WEBHOOK_REQUEST_METHOD_name'] = 'Request method';
$pia_lang['WEBHOOK_REQUEST_METHOD_description'] = 'The HTTP request method to be used for the webhook call.';