mirror of
https://github.com/getgrav/grav.git
synced 2026-02-10 08:37:43 +01:00
use Inflector class to hyphenize for consistency and safety
This commit is contained in:
@@ -67,7 +67,8 @@ class Session extends BaseSession
|
||||
$httponly = $config->get('system.session.httponly', true);
|
||||
|
||||
$unique_identifier = GRAV_ROOT;
|
||||
$this->setName(str_replace(' ', '-', $config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : ''));
|
||||
$inflector = new Inflector();
|
||||
$this->setName($inflector->hyphenize($config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : ''));
|
||||
$this->start();
|
||||
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user