adding check for PATH ending in DIRECTORY_SEPARATOR, fixes #86

This commit is contained in:
El RIDO 2016-08-22 09:46:26 +02:00
parent 47d6bd7a02
commit 6aba39488f
6 changed files with 19 additions and 5 deletions

View File

@ -138,5 +138,7 @@
"Options": "Optionen", "Options": "Optionen",
"Shorten URL": "URL verkürzen", "Shorten URL": "URL verkürzen",
"Editor": "Bearbeiten", "Editor": "Bearbeiten",
"Preview": "Vorschau" "Preview": "Vorschau",
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
"Der PATH muss bei PrivateBin mit einem \"%s\" enden. Bitte passe Deinen PATH in Deiner index.php an."
} }

View File

@ -147,5 +147,7 @@
"Options": "Options", "Options": "Options",
"Shorten URL": "Raccourcir URL", "Shorten URL": "Raccourcir URL",
"Editor": "éditer", "Editor": "éditer",
"Preview": "avant-première" "Preview": "avant-première",
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php."
} }

View File

@ -138,5 +138,7 @@
"Options": "Opcje", "Options": "Opcje",
"Shorten URL": "Skróć adres URL", "Shorten URL": "Skróć adres URL",
"Editor": "Edytować", "Editor": "Edytować",
"Preview": "Zapowiedź" "Preview": "Zapowiedź",
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php."
} }

View File

@ -147,5 +147,7 @@
"Options": "Možnosti", "Options": "Možnosti",
"Shorten URL": "Skrajšajte URL", "Shorten URL": "Skrajšajte URL",
"Editor": "Uredi", "Editor": "Uredi",
"Preview": "Predogled" "Preview": "Predogled",
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php."
} }

View File

@ -138,5 +138,7 @@
"Options": "选项", "Options": "选项",
"Shorten URL": "缩短链接", "Shorten URL": "缩短链接",
"Editor": "編輯", "Editor": "編輯",
"Preview": "預習" "Preview": "預習",
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
"PrivateBin requires the PATH to end in a \"%s\". Please update the PATH in your index.php."
} }

View File

@ -114,6 +114,7 @@ class PrivateBin
* initializes and runs PrivateBin * initializes and runs PrivateBin
* *
* @access public * @access public
* @throws Exception
* @return void * @return void
*/ */
public function __construct() public function __construct()
@ -121,6 +122,9 @@ class PrivateBin
if (version_compare(PHP_VERSION, '5.3.0') < 0) { if (version_compare(PHP_VERSION, '5.3.0') < 0) {
throw new Exception(I18n::_('PrivateBin requires php 5.3.0 or above to work. Sorry.'), 1); throw new Exception(I18n::_('PrivateBin requires php 5.3.0 or above to work. Sorry.'), 1);
} }
if (strlen(PATH) < 0 && substr(PATH, -1) !== DIRECTORY_SEPARATOR) {
throw new Exception(I18n::_('PrivateBin requires the PATH to end in a "%s". Please update the PATH in your index.php.', DIRECTORY_SEPARATOR), 5);
}
// load config from ini file, initialize required classes // load config from ini file, initialize required classes
$this->_init(); $this->_init();