[fix] Do not create .htaccess with Nginx

This commit is contained in:
magikcypress 2017-04-28 17:41:05 +02:00
parent af595ed96d
commit 90087123ba
3 changed files with 21 additions and 14 deletions

View File

@ -75,6 +75,10 @@ languageselection = false
; sha256 in HMAC for the deletion token
zerobincompatibility = false
; allows you to specify the name of the web server you are using to use ParseBin.
; if you use Nginx, decommente and add nginx.
webserver = "Nginx"
[expire]
; expire value that is selected per default
; make sure the value exists in [expire_options]

View File

@ -54,6 +54,7 @@ class Configuration
'icon' => 'identicon',
'cspheader' => 'default-src \'none\'; manifest-src \'self\'; connect-src *; script-src \'self\'; style-src \'self\'; font-src \'self\'; img-src \'self\' data:; referrer no-referrer; sandbox allow-same-origin allow-scripts allow-forms allow-popups',
'zerobincompatibility' => false,
'webserver' => 'Apache',
),
'expire' => array(
'default' => '1week',

View File

@ -82,6 +82,7 @@ abstract class AbstractPersistence
*/
protected static function _initialize()
{
if (property_exists($data->meta, 'webserver') && $data->meta->webserver && $this->_conf->getKey('webserver') == "Apache") {
// Create storage directory if it does not exist.
if (!is_dir(self::$_path)) {
if (!@mkdir(self::$_path, 0700)) {
@ -100,6 +101,7 @@ abstract class AbstractPersistence
}
}
}
}
/**
* store the data