Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Always check via http and https whether htaccess is working
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and Backportbot committed Nov 12, 2019
commit 733f10cc16127a47d8b9fd4fa0f4e21a4637f85d
14 changes: 13 additions & 1 deletion lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1249,14 +1249,26 @@ public function isHtaccessWorking(\OCP\IConfig $config) {
$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);

/*
* If the content is not equal to test content our .htaccess
* is working as required
*/
return $content !== $testContent;
return $content !== $testContent && $fallbackContent !== $testContent;
}

/**
Expand Down