fixes #186 for good

This commit is contained in:
El RIDO 2017-03-24 19:20:34 +01:00
parent e5f4104720
commit 88b02d866e
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
13 changed files with 31 additions and 24 deletions

View File

@ -10,7 +10,7 @@ check the options and adjust them as you see fit.
### Requirements ### Requirements
- PHP version 5.3 or above - PHP version 5.4 or above
- _one_ of the following sources of cryptographically safe randomness is required: - _one_ of the following sources of cryptographically safe randomness is required:
- PHP 7 or higher - PHP 7 or higher
- [Libsodium](https://download.libsodium.org/libsodium/content/installation/) and it's [PHP extension](https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium) - [Libsodium](https://download.libsodium.org/libsodium/content/installation/) and it's [PHP extension](https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium)

View File

@ -18,7 +18,7 @@
} }
], ],
"require": { "require": {
"php": "^5.3.0 || ^7.0", "php": "^5.4.0 || ^7.0",
"paragonie/random_compat": "2.0.4", "paragonie/random_compat": "2.0.4",
"yzalis/identicon": "1.1.0" "yzalis/identicon": "1.1.0"
}, },

View File

@ -7,8 +7,8 @@
"en": "de", "en": "de",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Diesen Text gibt es nicht, er ist abgelaufen oder wurde gelöscht.", "Diesen Text gibt es nicht, er ist abgelaufen oder wurde gelöscht.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"%s benötigt PHP 5.3.0 oder höher, um zu funktionieren. Sorry.", "%s benötigt PHP %s oder höher, um zu funktionieren. Sorry.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s benötigt den Konfigurationsabschnitt [%s] in der Konfigurationsdatei um zu funktionieren.", "%s benötigt den Konfigurationsabschnitt [%s] in der Konfigurationsdatei um zu funktionieren.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "es", "en": "es",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"El texto no existe, ha caducado o ha sido eliminado.", "El texto no existe, ha caducado o ha sido eliminado.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"%s requiere php 5.3.0 o superior para funcionar. Lo siento.", "%s requiere php %s o superior para funcionar. Lo siento.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s requiere que la sección de configuración [%s] esté presente en el archivo de configuración.", "%s requiere que la sección de configuración [%s] esté presente en el archivo de configuración.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "fr", "en": "fr",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Le paste n'existe pas, a expiré, ou a été supprimé.", "Le paste n'existe pas, a expiré, ou a été supprimé.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"Désolé, %s nécessite php 5.3.0 ou supérieur pour fonctionner.", "Désolé, %s nécessite php %s ou supérieur pour fonctionner.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s a besoin de la section de configuration [%s] dans le fichier de configuration pour fonctionner.", "%s a besoin de la section de configuration [%s] dans le fichier de configuration pour fonctionner.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "it", "en": "it",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Questo messaggio non esiste, è scaduto o è stato cancellato.", "Questo messaggio non esiste, è scaduto o è stato cancellato.",
"%s requires php 5.4.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"%s richiede php 5.4.0 o superiore per funzionare. Ci spiace.", "%s richiede php %s o superiore per funzionare. Ci spiace.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s richiede la presenza della sezione [%s] nei file di configurazione.", "%s richiede la presenza della sezione [%s] nei file di configurazione.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "no", "en": "no",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Innlegget eksisterer ikke, er utløpt eller har blitt slettet.", "Innlegget eksisterer ikke, er utløpt eller har blitt slettet.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"Beklager, %s krever php 5.3.0 eller nyere for å kjøre.", "Beklager, %s krever php %s eller nyere for å kjøre.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s krever konfigurasjonsdel [%s] å være til stede i konfigurasjonsfilen .", "%s krever konfigurasjonsdel [%s] å være til stede i konfigurasjonsfilen .",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "oc", "en": "oc",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Lo tèxte existís pas, a expirat, o es estat suprimit.", "Lo tèxte existís pas, a expirat, o es estat suprimit.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"O planhèm, %s necessita php 5.3.0 o superior per foncionar.", "O planhèm, %s necessita php %s o superior per foncionar.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s fa besonh de la seccion de configuracion [%s] dins lo fichièr de configuracion per foncionar.", "%s fa besonh de la seccion de configuracion [%s] dins lo fichièr de configuracion per foncionar.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "pl", "en": "pl",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Wklejka nie istnieje, wygasła albo została usunięta.", "Wklejka nie istnieje, wygasła albo została usunięta.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"%s wymaga PHP w wersji 5.3.0 lub nowszej, sorry.", "%s wymaga PHP w wersji %s lub nowszej, sorry.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s wymaga obecności sekcji [%s] w pliku konfiguracyjnym.", "%s wymaga obecności sekcji [%s] w pliku konfiguracyjnym.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "pt", "en": "pt",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"A cópia não existe, expirou ou já foi excluída.", "A cópia não existe, expirou ou já foi excluída.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"%s requer php 5.3.0 ou superior para funcionar. Desculpa.", "%s requer php %s ou superior para funcionar. Desculpa.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s requer que a seção de configuração [% s] esteja no arquivo de configuração.", "%s requer que a seção de configuração [% s] esteja no arquivo de configuração.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "sl", "en": "sl",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"Prilepek ne obstaja, mu je potekla življenjska doba, ali pa je izbrisan.", "Prilepek ne obstaja, mu je potekla življenjska doba, ali pa je izbrisan.",
"%s requires php 5.3.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"Oprosti, %s za delovanje potrebuje vsaj php 5.3.0.", "Oprosti, %s za delovanje potrebuje vsaj php %s.",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s potrebuje sekcijo konfiguracij [%s] v konfiguracijski datoteki.", "%s potrebuje sekcijo konfiguracij [%s] v konfiguracijski datoteki.",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -7,8 +7,8 @@
"en": "zh", "en": "zh",
"Paste does not exist, has expired or has been deleted.": "Paste does not exist, has expired or has been deleted.":
"粘贴不存在,已过期或者已被删除。", "粘贴不存在,已过期或者已被删除。",
"%s requires php 5.4.0 or above to work. Sorry.": "%s requires php %s or above to work. Sorry.":
"%s需要工作于PHP 5.4.0及以上版本,抱歉。", "%s需要工作于PHP %s及以上版本,抱歉。",
"%s requires configuration section [%s] to be present in configuration file.": "%s requires configuration section [%s] to be present in configuration file.":
"%s需要设置配置文件中 [%s] 的部分。", "%s需要设置配置文件中 [%s] 的部分。",
"Please wait %d seconds between each post.": "Please wait %d seconds between each post.":

View File

@ -30,6 +30,13 @@ class PrivateBin
*/ */
const VERSION = '1.1'; const VERSION = '1.1';
/**
* minimal required PHP version
*
* @const string
*/
const MIN_PHP_VERSION = '5.4.0';
/** /**
* show the same error message if the paste expired or does not exist * show the same error message if the paste expired or does not exist
* *
@ -120,8 +127,8 @@ class PrivateBin
*/ */
public function __construct() public function __construct()
{ {
if (version_compare(PHP_VERSION, '5.4.0') < 0) { if (version_compare(PHP_VERSION, self::MIN_PHP_VERSION) < 0) {
throw new Exception(I18n::_('%s requires php 5.4.0 or above to work. Sorry.', I18n::_('PrivateBin')), 1); throw new Exception(I18n::_('%s requires php %s or above to work. Sorry.', I18n::_('PrivateBin'), self::MIN_PHP_VERSION), 1);
} }
if (strlen(PATH) < 0 && substr(PATH, -1) !== DIRECTORY_SEPARATOR) { if (strlen(PATH) < 0 && substr(PATH, -1) !== DIRECTORY_SEPARATOR) {
throw new Exception(I18n::_('%s requires the PATH to end in a "%s". Please update the PATH in your index.php.', I18n::_('PrivateBin'), DIRECTORY_SEPARATOR), 5); throw new Exception(I18n::_('%s requires the PATH to end in a "%s". Please update the PATH in your index.php.', I18n::_('PrivateBin'), DIRECTORY_SEPARATOR), 5);