Skip to content

Commit e8a89aa

Browse files
committed
Remove leftovers from previously supported PHP-version
1 parent 6bb7a1d commit e8a89aa

7 files changed

Lines changed: 3 additions & 62 deletions

File tree

lib/SimpleSAML/Session.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,6 @@ public function markDirty()
482482

483483
$this->dirty = true;
484484

485-
if (!function_exists('header_register_callback')) {
486-
// PHP version < 5.4, can't register the callback
487-
return;
488-
}
489-
490485
if ($this->callback_registered) {
491486
// we already have a shutdown callback registered for this object, no need to add another one
492487
return;

lib/SimpleSAML/SessionHandlerPHP.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ protected function __construct()
4949
$config = \SimpleSAML_Configuration::getInstance();
5050
$this->cookie_name = $config->getString('session.phpsession.cookiename', null);
5151

52-
if (function_exists('session_status') && defined('PHP_SESSION_ACTIVE')) { // PHP >= 5.4
53-
$previous_session = session_status() === PHP_SESSION_ACTIVE;
54-
} else {
55-
$previous_session = (session_id() !== '') && (session_name() !== $this->cookie_name);
56-
}
57-
58-
if ($previous_session) {
52+
if (session_status() === PHP_SESSION_ACTIVE) {
5953
if (session_name() === $this->cookie_name || $this->cookie_name === null) {
6054
Logger::warning(
6155
'There is already a PHP session with the same name as SimpleSAMLphp\'s session, or the '.

templates/selectidp-dropdown.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,12 @@
3333
value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>"/>
3434
<select id="dropdownlist" name="idpentityid">
3535
<?php
36-
/*
37-
* TODO: change this to use $this instead when PHP 5.4 is the minimum requirement.
38-
*
39-
* This is a dirty hack because PHP 5.3 does not allow the use of $this inside closures. Therefore, the
40-
* translation function must be passed somehow inside the closure. PHP 5.4 allows using $this, so we can
41-
* then go back to the previous behaviour.
42-
*/
43-
$GLOBALS['__t'] = $this;
4436
usort($this->data['idplist'], function ($idpentry1, $idpentry2) {
4537
return strcmp(
46-
$GLOBALS['__t']->t('idpname_'.$idpentry1['entityid']),
47-
$GLOBALS['__t']->t('idpname_'.$idpentry2['entityid'])
38+
$this->t('idpname_'.$idpentry1['entityid']),
39+
$this->t('idpname_'.$idpentry2['entityid'])
4840
);
4941
});
50-
unset($GLOBALS['__t']);
5142

5243
foreach ($this->data['idplist'] as $idpentry) {
5344
echo '<option value="'.htmlspecialchars($idpentry['entityid']).'"';

tests/lib/SimpleSAML/DatabaseTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class SimpleSAML_DatabaseTest extends TestCase
3131
* Make protected functions available for testing
3232
*
3333
* @param string $getMethod The method to get.
34-
* @requires PHP 5.3.2
35-
*
3634
* @return mixed The method itself.
3735
*/
3836
protected static function getMethod($getMethod)

tests/lib/SimpleSAML/Utils/SystemTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public function testWriteFileInvalidArguments()
110110
}
111111

112112
/**
113-
* @requires PHP 5.4.0
114113
* @covers \SimpleSAML\Utils\System::writeFile
115114
* @test
116115
*/
@@ -129,7 +128,6 @@ public function testWriteFileBasic()
129128
}
130129

131130
/**
132-
* @requires PHP 5.4.0
133131
* @covers \SimpleSAML\Utils\System::writeFile
134132
* @test
135133
*/
@@ -152,7 +150,6 @@ public function testWriteFileContents()
152150
}
153151

154152
/**
155-
* @requires PHP 5.4.0
156153
* @covers \SimpleSAML\Utils\System::writeFile
157154
* @test
158155
*/
@@ -211,7 +208,6 @@ public function testGetTempDirNonExistant()
211208
}
212209

213210
/**
214-
* @requires PHP 5.4.0
215211
* @requires OS Linux
216212
* @covers \SimpleSAML\Utils\System::getTempDir
217213
* @test

tests/www/IndexTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ public function testRedirection()
7171
$this->markTestSkipped('The web-based tests cannot be run in HHVM for the moment.');
7272
}
7373

74-
if (version_compare(phpversion(), '5.4') === -1) {
75-
// no built-in server prior to 5.4
76-
$this->markTestSkipped('The web-based tests cannot be run in PHP versions older than 5.4.');
77-
}
78-
7974
// test most basic redirection
8075
$this->updateConfig(array(
8176
'baseurlpath' => 'http://example.org/simplesaml/'

www/_include.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
<?php
22

3-
/**
4-
* Disable magic quotes if they are enabled.
5-
*/
6-
function removeMagicQuotes()
7-
{
8-
if (get_magic_quotes_gpc()) {
9-
foreach (array('_GET', '_POST', '_COOKIE', '_REQUEST') as $a) {
10-
if (isset($$a) && is_array($$a)) {
11-
foreach ($$a as &$v) {
12-
// we don't use array-parameters anywhere. Ignore any that may appear
13-
if (is_array($v)) {
14-
continue;
15-
}
16-
// unescape the string
17-
$v = stripslashes($v);
18-
}
19-
}
20-
}
21-
}
22-
if (get_magic_quotes_runtime()) {
23-
set_magic_quotes_runtime(false);
24-
}
25-
}
26-
27-
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
28-
removeMagicQuotes();
29-
}
30-
313
// initialize the autoloader
324
require_once(dirname(dirname(__FILE__)).'/lib/_autoload.php');
335

0 commit comments

Comments
 (0)