Skip to content
Snippets Groups Projects
Commit e8a89aaf authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Remove leftovers from previously supported PHP-version

parent 6bb7a1da
Branches
Tags
No related merge requests found
......@@ -482,11 +482,6 @@ class SimpleSAML_Session implements Serializable
$this->dirty = true;
if (!function_exists('header_register_callback')) {
// PHP version < 5.4, can't register the callback
return;
}
if ($this->callback_registered) {
// we already have a shutdown callback registered for this object, no need to add another one
return;
......
......@@ -49,13 +49,7 @@ class SessionHandlerPHP extends SessionHandler
$config = \SimpleSAML_Configuration::getInstance();
$this->cookie_name = $config->getString('session.phpsession.cookiename', null);
if (function_exists('session_status') && defined('PHP_SESSION_ACTIVE')) { // PHP >= 5.4
$previous_session = session_status() === PHP_SESSION_ACTIVE;
} else {
$previous_session = (session_id() !== '') && (session_name() !== $this->cookie_name);
}
if ($previous_session) {
if (session_status() === PHP_SESSION_ACTIVE) {
if (session_name() === $this->cookie_name || $this->cookie_name === null) {
Logger::warning(
'There is already a PHP session with the same name as SimpleSAMLphp\'s session, or the '.
......
......@@ -33,21 +33,12 @@ foreach ($this->data['idplist'] as $idpentry) {
value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>"/>
<select id="dropdownlist" name="idpentityid">
<?php
/*
* TODO: change this to use $this instead when PHP 5.4 is the minimum requirement.
*
* This is a dirty hack because PHP 5.3 does not allow the use of $this inside closures. Therefore, the
* translation function must be passed somehow inside the closure. PHP 5.4 allows using $this, so we can
* then go back to the previous behaviour.
*/
$GLOBALS['__t'] = $this;
usort($this->data['idplist'], function ($idpentry1, $idpentry2) {
return strcmp(
$GLOBALS['__t']->t('idpname_'.$idpentry1['entityid']),
$GLOBALS['__t']->t('idpname_'.$idpentry2['entityid'])
$this->t('idpname_'.$idpentry1['entityid']),
$this->t('idpname_'.$idpentry2['entityid'])
);
});
unset($GLOBALS['__t']);
foreach ($this->data['idplist'] as $idpentry) {
echo '<option value="'.htmlspecialchars($idpentry['entityid']).'"';
......
......@@ -31,8 +31,6 @@ class SimpleSAML_DatabaseTest extends TestCase
* Make protected functions available for testing
*
* @param string $getMethod The method to get.
* @requires PHP 5.3.2
*
* @return mixed The method itself.
*/
protected static function getMethod($getMethod)
......
......@@ -110,7 +110,6 @@ class SystemTest extends TestCase
}
/**
* @requires PHP 5.4.0
* @covers \SimpleSAML\Utils\System::writeFile
* @test
*/
......@@ -129,7 +128,6 @@ class SystemTest extends TestCase
}
/**
* @requires PHP 5.4.0
* @covers \SimpleSAML\Utils\System::writeFile
* @test
*/
......@@ -152,7 +150,6 @@ class SystemTest extends TestCase
}
/**
* @requires PHP 5.4.0
* @covers \SimpleSAML\Utils\System::writeFile
* @test
*/
......@@ -211,7 +208,6 @@ class SystemTest extends TestCase
}
/**
* @requires PHP 5.4.0
* @requires OS Linux
* @covers \SimpleSAML\Utils\System::getTempDir
* @test
......
......@@ -71,11 +71,6 @@ class IndexTest extends TestCase
$this->markTestSkipped('The web-based tests cannot be run in HHVM for the moment.');
}
if (version_compare(phpversion(), '5.4') === -1) {
// no built-in server prior to 5.4
$this->markTestSkipped('The web-based tests cannot be run in PHP versions older than 5.4.');
}
// test most basic redirection
$this->updateConfig(array(
'baseurlpath' => 'http://example.org/simplesaml/'
......
<?php
/**
* Disable magic quotes if they are enabled.
*/
function removeMagicQuotes()
{
if (get_magic_quotes_gpc()) {
foreach (array('_GET', '_POST', '_COOKIE', '_REQUEST') as $a) {
if (isset($$a) && is_array($$a)) {
foreach ($$a as &$v) {
// we don't use array-parameters anywhere. Ignore any that may appear
if (is_array($v)) {
continue;
}
// unescape the string
$v = stripslashes($v);
}
}
}
}
if (get_magic_quotes_runtime()) {
set_magic_quotes_runtime(false);
}
}
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
removeMagicQuotes();
}
// initialize the autoloader
require_once(dirname(dirname(__FILE__)).'/lib/_autoload.php');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment