Fix #27011: Session ini_set bug
This commit is contained in:
parent
bf8ed0a3fc
commit
64a0f23aff
@ -340,7 +340,7 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
}
|
||||
|
||||
$validOptions = array_flip(array(
|
||||
'cache_limiter', 'cookie_domain', 'cookie_httponly',
|
||||
'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly',
|
||||
'cookie_lifetime', 'cookie_path', 'cookie_secure',
|
||||
'entropy_file', 'entropy_length', 'gc_divisor',
|
||||
'gc_maxlifetime', 'gc_probability', 'hash_bits_per_character',
|
||||
@ -348,13 +348,13 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
'serialize_handler', 'use_strict_mode', 'use_cookies',
|
||||
'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled',
|
||||
'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name',
|
||||
'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags',
|
||||
'upload_progress.freq', 'upload_progress.min_freq', 'url_rewriter.tags',
|
||||
'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags',
|
||||
));
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
if (isset($validOptions[$key])) {
|
||||
ini_set('session.'.$key, $value);
|
||||
ini_set('url_rewriter.tags' !== $key ? 'session.'.$key : $key, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -183,6 +183,23 @@ class NativeSessionStorageTest extends TestCase
|
||||
$this->assertEquals($options, $gco);
|
||||
}
|
||||
|
||||
public function testSessionOptions()
|
||||
{
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped('HHVM is not handled in this test case.');
|
||||
}
|
||||
|
||||
$options = array(
|
||||
'url_rewriter.tags' => 'a=href',
|
||||
'cache_expire' => '200',
|
||||
);
|
||||
|
||||
$this->getStorage($options);
|
||||
|
||||
$this->assertSame('a=href', ini_get('url_rewriter.tags'));
|
||||
$this->assertSame('200', ini_get('session.cache_expire'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user