Skip to content

Commit ab17fb2

Browse files
committed
use Inflector class to hyphenize for consistency and safety
1 parent 2bb6d1d commit ab17fb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

system/src/Grav/Common/Session.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public function init()
6767
$httponly = $config->get('system.session.httponly', true);
6868

6969
$unique_identifier = GRAV_ROOT;
70-
$this->setName(str_replace(' ', '-', $config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : ''));
70+
$inflector = new Inflector();
71+
$this->setName($inflector->hyphenize($config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : ''));
7172
$this->start();
7273
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
7374
}

0 commit comments

Comments
 (0)