Просмотр исходного кода

adding check for PATH ending in DIRECTORY_SEPARATOR, fixes #86

El RIDO 10 лет назад
Родитель
Сommit
6aba39488f
6 измененных файлов с 19 добавлено и 5 удалено
  1. 3 1
      i18n/de.json
  2. 3 1
      i18n/fr.json
  3. 3 1
      i18n/pl.json
  4. 3 1
      i18n/sl.json
  5. 3 1
      i18n/zh.json
  6. 4 0
      lib/PrivateBin.php

+ 3 - 1
i18n/de.json

@@ -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."
 }

+ 3 - 1
i18n/fr.json

@@ -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."
 }

+ 3 - 1
i18n/pl.json

@@ -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."
 }

+ 3 - 1
i18n/sl.json

@@ -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."
 }

+ 3 - 1
i18n/zh.json

@@ -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."
 }

+ 4 - 0
lib/PrivateBin.php

@@ -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();