From e88d06dc88bc263b7424fbccfa47c13907413b8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 22 Sep 2021 15:08:47 +0200 Subject: [PATCH] Check whether WCFSetup is accessed using HTTPS Resolves #4502 --- .../files/lib/system/WCFSetup.class.php | 2 ++ wcfsetup/setup/lang/setup_de.xml | 2 ++ wcfsetup/setup/lang/setup_en.xml | 2 ++ .../template/stepShowSystemRequirements.tpl | 22 +++++++++++++++++++ 4 files changed, 28 insertions(+) diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index f8b2525c25..3135a1e903 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -436,6 +436,8 @@ class WCFSetup extends WCF $system['cookie']['result'] = !empty($_COOKIE['wcfsetup_cookietest']) && $_COOKIE['wcfsetup_cookietest'] == TMP_FILE_PREFIX; + $system['tls']['result'] = RouteHandler::secureConnection() || $system['hostname']['value'] == 'localhost'; + foreach ($system as $result) { if (!$result['result']) { WCF::getTPL()->assign([ diff --git a/wcfsetup/setup/lang/setup_de.xml b/wcfsetup/setup/lang/setup_de.xml index 4f7d9822fb..1e36745109 100644 --- a/wcfsetup/setup/lang/setup_de.xml +++ b/wcfsetup/setup/lang/setup_de.xml @@ -48,6 +48,8 @@ + + diff --git a/wcfsetup/setup/lang/setup_en.xml b/wcfsetup/setup/lang/setup_en.xml index c86df9de64..03a2775eaa 100644 --- a/wcfsetup/setup/lang/setup_en.xml +++ b/wcfsetup/setup/lang/setup_en.xml @@ -48,6 +48,8 @@ + + diff --git a/wcfsetup/setup/template/stepShowSystemRequirements.tpl b/wcfsetup/setup/template/stepShowSystemRequirements.tpl index 2a4235a565..059e381f6d 100644 --- a/wcfsetup/setup/template/stepShowSystemRequirements.tpl +++ b/wcfsetup/setup/template/stepShowSystemRequirements.tpl @@ -154,6 +154,28 @@

{lang}wcf.global.systemRequirements.recommended{/lang}

+
+

{lang}wcf.global.systemRequirements.tls{/lang}

+ +
+
+
{lang}wcf.global.systemRequirements.element.required{/lang}
+
{lang}wcf.global.systemRequirements.active{/lang}
+
+ +
+
{lang}wcf.global.systemRequirements.element.yours{/lang}
+
+ + {if !$system.tls.result}{lang}wcf.global.systemRequirements.notActive{/lang}{else} + {lang}wcf.global.systemRequirements.active{/lang} + {/if} + {if !$system.tls.result}{lang}wcf.global.systemRequirements.tls.description{/lang}{/if} +
+
+
+
+

{lang}wcf.global.systemRequirements.uploadMaxFilesize{/lang}

-- 2.20.1