Skip to content

Commit

Permalink
fixes #186 for good
Browse files Browse the repository at this point in the history
  • Loading branch information
elrido committed Mar 24, 2017
1 parent e5f4104 commit 88b02d8
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Expand Up @@ -10,7 +10,7 @@ check the options and adjust them as you see fit.

### Requirements

- PHP version 5.3 or above
- PHP version 5.4 or above
- _one_ of the following sources of cryptographically safe randomness is required:
- 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)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": "^5.3.0 || ^7.0",
"php": "^5.4.0 || ^7.0",
"paragonie/random_compat": "2.0.4",
"yzalis/identicon": "1.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions i18n/de.json
Expand Up @@ -7,8 +7,8 @@
"en": "de",
"Paste does not exist, has expired or has been deleted.":
"Diesen Text gibt es nicht, er ist abgelaufen oder wurde gelöscht.",
"%s requires php 5.3.0 or above to work. Sorry.":
"%s benötigt PHP 5.3.0 oder höher, um zu funktionieren. Sorry.",
"%s requires php %s or above to work. 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 benötigt den Konfigurationsabschnitt [%s] in der Konfigurationsdatei um zu funktionieren.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/es.json
Expand Up @@ -7,8 +7,8 @@
"en": "es",
"Paste does not exist, has expired or has been deleted.":
"El texto no existe, ha caducado o ha sido eliminado.",
"%s requires php 5.3.0 or above to work. Sorry.":
"%s requiere php 5.3.0 o superior para funcionar. Lo siento.",
"%s requires php %s or above to work. Sorry.":
"%s requiere php %s o superior para funcionar. Lo siento.",
"%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.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/fr.json
Expand Up @@ -7,8 +7,8 @@
"en": "fr",
"Paste does not exist, has expired or has been deleted.":
"Le paste n'existe pas, a expiré, ou a été supprimé.",
"%s requires php 5.3.0 or above to work. Sorry.":
"Désolé, %s nécessite php 5.3.0 ou supérieur pour fonctionner.",
"%s requires php %s or above to work. Sorry.":
"Désolé, %s nécessite php %s ou supérieur pour fonctionner.",
"%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.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/it.json
Expand Up @@ -7,8 +7,8 @@
"en": "it",
"Paste does not exist, has expired or has been deleted.":
"Questo messaggio non esiste, è scaduto o è stato cancellato.",
"%s requires php 5.4.0 or above to work. Sorry.":
"%s richiede php 5.4.0 o superiore per funzionare. Ci spiace.",
"%s requires php %s or above to work. Sorry.":
"%s richiede php %s o superiore per funzionare. Ci spiace.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s richiede la presenza della sezione [%s] nei file di configurazione.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/no.json
Expand Up @@ -7,8 +7,8 @@
"en": "no",
"Paste does not exist, has expired or has been deleted.":
"Innlegget eksisterer ikke, er utløpt eller har blitt slettet.",
"%s requires php 5.3.0 or above to work. Sorry.":
"Beklager, %s krever php 5.3.0 eller nyere for å kjøre.",
"%s requires php %s or above to work. Sorry.":
"Beklager, %s krever php %s eller nyere for å kjøre.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s krever konfigurasjonsdel [%s] å være til stede i konfigurasjonsfilen .",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/oc.json
Expand Up @@ -7,8 +7,8 @@
"en": "oc",
"Paste does not exist, has expired or has been deleted.":
"Lo tèxte existís pas, a expirat, o es estat suprimit.",
"%s requires php 5.3.0 or above to work. Sorry.":
"O planhèm, %s necessita php 5.3.0 o superior per foncionar.",
"%s requires php %s or above to work. Sorry.":
"O planhèm, %s necessita php %s o superior per foncionar.",
"%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.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/pl.json
Expand Up @@ -7,8 +7,8 @@
"en": "pl",
"Paste does not exist, has expired or has been deleted.":
"Wklejka nie istnieje, wygasła albo została usunięta.",
"%s requires php 5.3.0 or above to work. Sorry.":
"%s wymaga PHP w wersji 5.3.0 lub nowszej, sorry.",
"%s requires php %s or above to work. Sorry.":
"%s wymaga PHP w wersji %s lub nowszej, sorry.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s wymaga obecności sekcji [%s] w pliku konfiguracyjnym.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/pt.json
Expand Up @@ -7,8 +7,8 @@
"en": "pt",
"Paste does not exist, has expired or has been deleted.":
"A cópia não existe, expirou ou já foi excluída.",
"%s requires php 5.3.0 or above to work. Sorry.":
"%s requer php 5.3.0 ou superior para funcionar. Desculpa.",
"%s requires php %s or above to work. Sorry.":
"%s requer php %s ou superior para funcionar. Desculpa.",
"%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.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/sl.json
Expand Up @@ -7,8 +7,8 @@
"en": "sl",
"Paste does not exist, has expired or has been deleted.":
"Prilepek ne obstaja, mu je potekla življenjska doba, ali pa je izbrisan.",
"%s requires php 5.3.0 or above to work. Sorry.":
"Oprosti, %s za delovanje potrebuje vsaj php 5.3.0.",
"%s requires php %s or above to work. Sorry.":
"Oprosti, %s za delovanje potrebuje vsaj php %s.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s potrebuje sekcijo konfiguracij [%s] v konfiguracijski datoteki.",
"Please wait %d seconds between each post.":
Expand Down
4 changes: 2 additions & 2 deletions i18n/zh.json
Expand Up @@ -7,8 +7,8 @@
"en": "zh",
"Paste does not exist, has expired or has been deleted.":
"粘贴不存在,已过期或者已被删除。",
"%s requires php 5.4.0 or above to work. Sorry.":
"%s需要工作于PHP 5.4.0及以上版本,抱歉。",
"%s requires php %s or above to work. Sorry.":
"%s需要工作于PHP %s及以上版本,抱歉。",
"%s requires configuration section [%s] to be present in configuration file.":
"%s需要设置配置文件中 [%s] 的部分。",
"Please wait %d seconds between each post.":
Expand Down
11 changes: 9 additions & 2 deletions lib/PrivateBin.php
Expand Up @@ -30,6 +30,13 @@ class PrivateBin
*/
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
*
Expand Down Expand Up @@ -120,8 +127,8 @@ class PrivateBin
*/
public function __construct()
{
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
throw new Exception(I18n::_('%s requires php 5.4.0 or above to work. Sorry.', I18n::_('PrivateBin')), 1);
if (version_compare(PHP_VERSION, self::MIN_PHP_VERSION) < 0) {
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) {
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);
Expand Down

0 comments on commit 88b02d8

Please sign in to comment.