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",
"Shorten URL": "URL verkürzen",
"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",
"Shorten URL": "Raccourcir URL",
"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",
"Shorten URL": "Skróć adres URL",
"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",
"Shorten URL": "Skrajšajte URL",
"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": "选项",
"Shorten URL": "缩短链接",
"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
*
* @access public
* @throws Exception
* @return void
*/
public function __construct()
@ -121,6 +122,9 @@ class PrivateBin
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);
}
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
$this->_init();