1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-08 23:26:34 +02:00

Version 1.2.1 Editor Improvement

This commit is contained in:
Sebastian
2018-07-06 10:31:20 +02:00
parent 0df0bd5a8e
commit 1aa20023d0
23 changed files with 254 additions and 380 deletions

View File

@@ -103,7 +103,7 @@ $container['assets'] = function($c)
* DECIDE FOR SESSION *
************************/
$session_segments = array('setup', 'tm/', '/setup', '/tm/');
$session_segments = array('setup', 'tm/', 'api/', '/setup', '/tm/', '/api/');
$path = $container['request']->getUri()->getPath();
$container['flash'] = false;
$container['csrf'] = false;
@@ -112,7 +112,7 @@ foreach($session_segments as $segment)
{
if(substr( $path, 0, strlen($segment) ) === $segment)
{
/* start a session */
// configure session
ini_set( 'session.cookie_httponly', 1 );
ini_set('session.use_strict_mode', 1);
if($container['request']->getUri()->getScheme() == 'https')
@@ -124,9 +124,8 @@ foreach($session_segments as $segment)
{
session_name('typemill-session');
}
session_start();
/* add csrf-protection */
// add csrf-protection
$container['csrf'] = function ($c)
{
$guard = new \Slim\Csrf\Guard();
@@ -135,11 +134,14 @@ foreach($session_segments as $segment)
return $guard;
};
/* add flash to container */
// add flash to container
$container['flash'] = function ()
{
return new \Slim\Flash\Messages();
};
// start session
session_start();
}
}