aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-08-23 16:37:40 +0200
committerGitHub <noreply@github.com>2019-08-23 16:37:40 +0200
commit95ce9615d04c53e0f068a2dab3affcd8ca5703e2 (patch)
tree38b6d476142a4e9fa349409c9e52479da648d2eb
parent443181f9502cf7b9e552b89003bc7940fd745a17 (diff)
parent92862c51f51fcf7e374a19041eef1012226a21bc (diff)
downloadnextcloud-server-95ce9615d04c53e0f068a2dab3affcd8ca5703e2.tar.gz
nextcloud-server-95ce9615d04c53e0f068a2dab3affcd8ca5703e2.zip
Merge pull request #16846 from nextcloud/bugfix/noid/check-https-and-http-content
Always check via http and https whether htaccess is working
-rw-r--r--lib/private/legacy/util.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 810f22fb9e5..eed49aff313 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -1249,6 +1249,18 @@ class OC_Util {
$content = false;
}
+ if (strpos($url, 'https:') === 0) {
+ $url = 'http:' . substr($url, 6);
+ } else {
+ $url = 'https:' . substr($url, 5);
+ }
+
+ try {
+ $fallbackContent = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody();
+ } catch (\Exception $e) {
+ $fallbackContent = false;
+ }
+
// cleanup
@unlink($testFile);
@@ -1256,7 +1268,7 @@ class OC_Util {
* If the content is not equal to test content our .htaccess
* is working as required
*/
- return $content !== $testContent;
+ return $content !== $testContent && $fallbackContent !== $testContent;
}
/**