bumping required PHP to 5.4, removing unneccessary code, resolves #186

This commit is contained in:
El RIDO 2017-03-05 11:22:24 +01:00
parent db429d42d2
commit 823adb78ef
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
5 changed files with 3 additions and 32 deletions

View file

@ -3,6 +3,7 @@
* **next (not yet released)**
* ADDED: Translations for Spanish, Occitan, Norwegian and Portuguese
* ADDED: Option in configuration to change the default "PrivateBin" title of the site
* CHANGED: Minimum required PHP version is 5.4 (#186)
* CHANGED: Cleanup of bootstrap template variants and moved icons to `img` directory
* **1.1 (2016-12-26)**
* ADDED: Translations for Italian and Russian

View file

@ -21,21 +21,6 @@ use Exception;
*/
class Filter
{
/**
* strips slashes deeply
*
* @access public
* @static
* @param mixed $value
* @return mixed
*/
public static function stripslashesDeep($value)
{
return is_array($value) ?
array_map('self::stripslashesDeep', $value) :
stripslashes($value);
}
/**
* format a given time string into a human readable label (localized)
*

View file

@ -120,8 +120,8 @@ class PrivateBin
*/
public function __construct()
{
if (version_compare(PHP_VERSION, '5.3.0') < 0) {
throw new Exception(I18n::_('%s requires php 5.3.0 or above to work. Sorry.', I18n::_('PrivateBin')), 1);
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 (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);

View file

@ -80,13 +80,6 @@ class Request
*/
public function __construct()
{
// in case stupid admin has left magic_quotes enabled in php.ini (for PHP < 5.4)
if (version_compare(PHP_VERSION, '5.4.0') < 0 && get_magic_quotes_gpc()) {
$_POST = array_map('PrivateBin\\Filter::stripslashesDeep', $_POST);
$_GET = array_map('PrivateBin\\Filter::stripslashesDeep', $_GET);
$_COOKIE = array_map('PrivateBin\\Filter::stripslashesDeep', $_COOKIE);
}
// decide if we are in JSON API or HTML context
$this->_isJsonApi = $this->_detectJsonRequest();

View file

@ -4,14 +4,6 @@ use PrivateBin\Filter;
class FilterTest extends PHPUnit_Framework_TestCase
{
public function testFilterStripsSlashesDeeply()
{
$this->assertEquals(
array("f'oo", "b'ar", array("fo'o", "b'ar")),
Filter::stripslashesDeep(array("f\\'oo", "b\\'ar", array("fo\\'o", "b\\'ar")))
);
}
public function testFilterMakesTimesHumanlyReadable()
{
$this->assertEquals('5 minutes', Filter::formatHumanReadableTime('5min'));