From 5374602896bf2390a4b34b8dab0844ca878c92f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=BCller?= Date: Sun, 12 Mar 2023 11:39:38 +0100 Subject: [PATCH 01/12] fix 'Array and string offset access using curly braces' deprecated error --- libs/php_idn/idna.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/php_idn/idna.php b/libs/php_idn/idna.php index bac2b63..af8f98e 100644 --- a/libs/php_idn/idna.php +++ b/libs/php_idn/idna.php @@ -12,7 +12,7 @@ function ordUTF8($c, $index = 0, &$bytes = null) $bytes = 0; if ($index >= $len) return false; - $h = ord($c{$index}); + $h = ord($c[$index]); if ($h <= 0x7F) { $bytes = 1; return $h; @@ -21,18 +21,18 @@ function ordUTF8($c, $index = 0, &$bytes = null) return false; else if ($h <= 0xDF && $index < $len - 1) { $bytes = 2; - return ($h & 0x1F) << 6 | (ord($c{$index + 1}) & 0x3F); + return ($h & 0x1F) << 6 | (ord($c[$index + 1]) & 0x3F); } else if ($h <= 0xEF && $index < $len - 2) { $bytes = 3; - return ($h & 0x0F) << 12 | (ord($c{$index + 1}) & 0x3F) << 6 - | (ord($c{$index + 2}) & 0x3F); + return ($h & 0x0F) << 12 | (ord($c[$index + 1]) & 0x3F) << 6 + | (ord($c[$index + 2]) & 0x3F); } else if ($h <= 0xF4 && $index < $len - 3) { $bytes = 4; - return ($h & 0x0F) << 18 | (ord($c{$index + 1}) & 0x3F) << 12 - | (ord($c{$index + 2}) & 0x3F) << 6 - | (ord($c{$index + 3}) & 0x3F); + return ($h & 0x0F) << 18 | (ord($c[$index + 1]) & 0x3F) << 12 + | (ord($c[$index + 2]) & 0x3F) << 6 + | (ord($c[$index + 3]) & 0x3F); } else return false; From 9ef3938e100f2ce5ee97f73fc030df69496d99df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=BCller?= Date: Sun, 12 Mar 2023 11:40:27 +0100 Subject: [PATCH 02/12] fix error if server configs are renamed already --- create-server-config.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/create-server-config.php b/create-server-config.php index c3130da..f87c2aa 100644 --- a/create-server-config.php +++ b/create-server-config.php @@ -7,17 +7,26 @@ // This is needed because some hosts do not either unzip hidden files // or neither GitHub puts that file inside the zips. /********************************************************************/ +$apacheExampleName = "ApacheHtaccess"; +$apacheProductionName = ".htaccess"; +$iisExampleName = "IISWebConfig"; +$iisProductionName = "web.config"; if(stripos($_SERVER['SERVER_SOFTWARE'],'apache')!== false){ -$f = fopen(".htaccess", "a+"); -$f2 = fopen("ApacheHtaccess","r"); -fwrite($f, fread($f2, filesize("ApacheHtaccess"))); -fclose($f); -fclose($f2); + if(!file_exists($apacheProductionName)) { + $f = fopen($apacheProductionName, "a+"); + $f2 = fopen($apacheExampleName,"r"); + fwrite($f, fread($f2, filesize($apacheExampleName))); + fclose($f); + fclose($f2); + } +// skipping renaming file if it already exists } else { -$f = fopen("web.config", "a+"); -$f2 = fopen("IISWebConfig","r"); -fwrite($f, fread($f2, filesize("IISWebConfig"))); -fclose($f); -fclose($f2); + if(!file_exists($iisProductionName)) { + $f = fopen($iisProductionName, "a+"); + $f2 = fopen($iisExampleName,"r"); + fwrite($f, fread($f2, filesize($iisExampleName))); + fclose($f); + fclose($f2); + } } ?> From 7601038f6bec91dad1d959e4b10701a6619d694f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=BCller?= Date: Sun, 12 Mar 2023 11:41:04 +0100 Subject: [PATCH 03/12] fix php8 error on undefined const --- 404.php | 3 +++ index.php | 15 +++++++-------- template.php | 7 ++++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/404.php b/404.php index 1f01ea7..d3c6ced 100644 --- a/404.php +++ b/404.php @@ -1,4 +1,7 @@ getSetting($mysqli,"title")); define("WEB_URL", $db->getSetting($mysqli,"url")); define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); - -define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli,"subscribe_email")); -define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli,"subscribe_telegram")); -define("TG_BOT_USERNAME", $db->getSetting($mysqli,"tg_bot_username")); -define("TG_BOT_API_TOKEN", $db->getSetting($mysqli,"tg_bot_api_token")); -define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli,"google_recaptcha")); -define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli,"google_recaptcha_sitekey")); -define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli,"google_recaptcha_secret")); +define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli,"subscribe_email") ?: ""); +define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli,"subscribe_telegram") ?: ""); +define("TG_BOT_USERNAME", $db->getSetting($mysqli,"tg_bot_username") ?: ""); +define("TG_BOT_API_TOKEN", $db->getSetting($mysqli,"tg_bot_api_token") ?: ""); +define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli,"google_recaptcha") ?: ""); +define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli,"google_recaptcha_sitekey") ?: ""); +define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli,"google_recaptcha_secret") ?: ""); $offset = 0; if (isset($_GET['ajax'])) diff --git a/template.php b/template.php index ba89407..8729989 100644 --- a/template.php +++ b/template.php @@ -26,7 +26,8 @@ class Template{ if ( 'admin' == $str_url ) { $strSubsMenu = ''; } else { - if (SUBSCRIBE_EMAIL || SUBSCRIBE_TELEGRAM ) { + $strSubsMenu = ''; + if (defined('SUBSCRIBE_EMAIL') || defined('SUBSCRIBE_TELEGRAM') ) { // Subscriber menu is to be shown... $strSubsMenu = ''; - //echo ''; + return $array; } else{ return $array; diff --git a/index.php b/index.php index 96bb3dd..239ad7b 100644 --- a/index.php +++ b/index.php @@ -118,3 +118,10 @@ Template::render_header("Status"); Template::render_footer(); } +?> + + Date: Tue, 2 Apr 2024 18:12:51 +0200 Subject: [PATCH 09/12] fix header and footer not showing --- template.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/template.php b/template.php index 0709651..e8545c1 100644 --- a/template.php +++ b/template.php @@ -72,7 +72,6 @@ class Template{ - @@ -91,17 +90,6 @@ class Template{ -