From e64b0bb0ecfecc4a1a1ce434d70e1b17b3f8a8e5 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sat, 29 Apr 2017 02:36:47 +0200 Subject: [PATCH] [fix] a little bit error --- cfg/conf.ini.sample | 6 +++--- lib/Configuration.php | 2 +- lib/Persistence/AbstractPersistence.php | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cfg/conf.ini.sample b/cfg/conf.ini.sample index b806f4cd..d2a8033c 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 78aeb36c..1a7fee22 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 65b2c788..e1f484e2 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(