Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2016-03-15 06:09:59 +0300
committermattab <matthieu.aubry@gmail.com>2016-03-15 06:09:59 +0300
commit4c334be38b8426f54a7e6ab314a82ec25ce49c81 (patch)
tree9604c9dda613f40c128bb74679981d5f88143557 /plugins/Installation/ServerFilesGenerator.php
parente9cf5bec7d0e29238ddf2dbf985ed65a106fa2e9 (diff)
Generate .htaccess files even on non apache servers Fixes #9810
Diffstat (limited to 'plugins/Installation/ServerFilesGenerator.php')
-rw-r--r--plugins/Installation/ServerFilesGenerator.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/Installation/ServerFilesGenerator.php b/plugins/Installation/ServerFilesGenerator.php
index fcd780523d..6009854544 100644
--- a/plugins/Installation/ServerFilesGenerator.php
+++ b/plugins/Installation/ServerFilesGenerator.php
@@ -15,12 +15,10 @@ class ServerFilesGenerator
{
/**
* Generate Apache .htaccess files to restrict access
+ * .htaccess files are created on all webservers even Nginx, as sometimes Nginx knows how to handle .htaccess files
*/
public static function createHtAccessFiles()
{
- if (!SettingsServer::isApache()) {
- return;
- }
$denyAll = self::getDenyAllHtaccessContent();
$allow = self::getAllowHtaccessContent();
@@ -76,17 +74,17 @@ class ServerFilesGenerator
*
* Apache-specific; for IIS @see web.config
*
+ * .htaccess files are created on all webservers even Nginx, as sometimes Nginx knows how to handle .htaccess files
+ *
* @param string $path without trailing slash
* @param bool $overwrite whether to overwrite an existing file or not
* @param string $content
*/
protected static function createHtAccess($path, $overwrite = true, $content)
{
- if (SettingsServer::isApache()) {
- $file = $path . '/.htaccess';
- if ($overwrite || !file_exists($file)) {
- @file_put_contents($file, $content);
- }
+ $file = $path . '/.htaccess';
+ if ($overwrite || !file_exists($file)) {
+ @file_put_contents($file, $content);
}
}