diff --git a/cfg/conf.ini.sample b/cfg/conf.ini.sample index b806f4c..d2a8033 100644 --- a/cfg/conf.ini.sample +++ b/cfg/conf.ini.sample @@ -75,9 +75,9 @@ 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" +; allows you to specify the name of the web server you are using to use PrivateBin. +; if you use Nginx, uncomment and add nginx. +; webserver = "Nginx" [expire] ; expire value that is selected per default diff --git a/lib/Configuration.php b/lib/Configuration.php index 78aeb36..1a7fee2 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -54,7 +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', + 'webserver' => 'Apache', ), 'expire' => array( 'default' => '1week', diff --git a/lib/Persistence/AbstractPersistence.php b/lib/Persistence/AbstractPersistence.php index 65b2c78..e1f484e 100644 --- a/lib/Persistence/AbstractPersistence.php +++ b/lib/Persistence/AbstractPersistence.php @@ -82,13 +82,13 @@ 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)) { - throw new Exception('unable to create directory ' . self::$_path, 10); - } + // Create storage directory if it does not exist. + if (!is_dir(self::$_path)) { + if (!@mkdir(self::$_path, 0700)) { + throw new Exception('unable to create directory ' . self::$_path, 10); } + } + if (property_exists($data->meta, 'webserver') && $data->meta->webserver && $this->_conf->getKey('webserver') == "Apache") { $file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess'; if (!is_file($file)) { $writtenBytes = @file_put_contents(