You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return SetupResult::error($this->l10n->t('Your data directory and files are probably accessible from the internet. The .htaccess file is not working. It is strongly recommended that you configure your web server so that the data directory is no longer accessible, or move the data directory outside the web server document root.'));
50
+
if ($response->getStatusCode() < 400) {
51
+
// Read the response body
52
+
$body = $response->getBody();
53
+
if (is_resource($body)) {
54
+
$body = stream_get_contents($body, 64);
55
+
}
56
+
57
+
if (str_contains($body, '# Nextcloud data directory')) {
58
+
return SetupResult::error($this->l10n->t('Your data directory and files are probably accessible from the internet. The .htaccess file is not working. It is strongly recommended that you configure your web server so that the data directory is no longer accessible, or move the data directory outside the web server document root.'));
59
+
}
52
60
} else {
53
61
$this->logger->debug('[expected] Could not access data directory from outside.', ['url' => $dataUrl]);
Copy file name to clipboardExpand all lines: lib/private/legacy/OC_Util.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -687,7 +687,7 @@ public static function checkDataDirectoryPermissions($dataDirectory) {
687
687
688
688
/**
689
689
* Check that the data directory exists and is valid by
690
-
* checking the existence of the ".ocdata" file.
690
+
* checking the existence of the ".ncdata" file.
691
691
*
692
692
* @param string $dataDirectory data directory path
693
693
* @return array errors found
@@ -701,11 +701,11 @@ public static function checkDataDirectoryValidity($dataDirectory) {
701
701
'hint' => $l->t('Check the value of "datadirectory" in your configuration.')
702
702
];
703
703
}
704
-
if (!file_exists($dataDirectory . '/.ocdata')) {
704
+
705
+
if (!file_exists($dataDirectory . '/.ncdata')) {
705
706
$errors[] = [
706
707
'error' => $l->t('Your data directory is invalid.'),
707
-
'hint' => $l->t('Ensure there is a file called ".ocdata"' .
708
-
' in the root of the data directory.')
708
+
'hint' => $l->t('Ensure there is a file called "%1$s" in the root of the data directory. It should have the content: "%2$s"', ['.ncdata', '# Nextcloud data directory']),
0 commit comments