mirror of
https://github.com/typemill/typemill.git
synced 2025-08-02 04:10:24 +02:00
Version 1.1.7 Optimized Session Management
This commit is contained in:
2
cache/lastCache.txt
vendored
2
cache/lastCache.txt
vendored
@@ -1 +1 @@
|
||||
1528043723
|
||||
1528058075
|
@@ -26,12 +26,14 @@ abstract class Controller
|
||||
|
||||
if($this->c->request->getUri()->getScheme() == 'https')
|
||||
{
|
||||
$response = $response->withAddedHeader('Strict-Transport-Security', 'max-age=63072000');
|
||||
$response = $response->withAddedHeader('Strict-Transport-Security', 'max-age=63072000');
|
||||
$response = $response->withAddedHeader('Content-Security-Policy', 'default-src https:');
|
||||
}
|
||||
|
||||
$response = $response->withAddedHeader('X-Content-Type-Options', 'nosniff');
|
||||
$response = $response->withAddedHeader('X-Frame-Options', 'SAMEORIGIN');
|
||||
$response = $response->withAddedHeader('X-XSS-Protection', '1;mode=block');
|
||||
$response = $response->withAddedHeader('Referrer-Policy', 'no-referrer-when-downgrade');
|
||||
|
||||
return $this->c->view->render($response, $route, $data);
|
||||
}
|
||||
|
@@ -119,7 +119,7 @@ class PageController extends Controller
|
||||
}
|
||||
|
||||
$contentMD = $this->c->dispatcher->dispatch('onMarkdownLoaded', new OnMarkdownLoaded($contentMD))->getData();
|
||||
|
||||
|
||||
/* initialize parsedown */
|
||||
$parsedown = new ParsedownExtension();
|
||||
|
||||
@@ -133,16 +133,18 @@ class PageController extends Controller
|
||||
/* parse markdown-content-array to content-string */
|
||||
$contentHTML = $parsedown->markup($contentArray);
|
||||
$contentHTML = $this->c->dispatcher->dispatch('onHtmlLoaded', new OnHtmlLoaded($contentHTML))->getData();
|
||||
|
||||
/* extract the h1 headline*/
|
||||
$contentParts = explode("</h1>", $contentHTML);
|
||||
$title = isset($contentParts[0]) ? strip_tags($contentParts[0]) : $settings['title'];
|
||||
|
||||
$contentHTML = isset($contentParts[1]) ? $contentParts[1] : $contentHTML;
|
||||
|
||||
/* create excerpt from content */
|
||||
$excerpt = substr($contentHTML,0,500);
|
||||
$excerpt = explode("</h1>", $excerpt);
|
||||
|
||||
/* extract title from excerpt */
|
||||
$title = isset($excerpt[0]) ? strip_tags($excerpt[0]) : $settings['title'];
|
||||
|
||||
/* create description from excerpt */
|
||||
$description = isset($excerpt[1]) ? strip_tags($excerpt[1]) : false;
|
||||
$description = isset($excerpt) ? strip_tags($excerpt) : false;
|
||||
if($description)
|
||||
{
|
||||
$description = trim(preg_replace('/\s+/', ' ', $description));
|
||||
@@ -162,7 +164,7 @@ class PageController extends Controller
|
||||
$firstImage = array('img_url' => $base_url . $img_url[1], 'img_alt' => $img_alt[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$route = empty($args) && $settings['startpage'] ? '/cover.twig' : '/index.twig';
|
||||
|
||||
return $this->render($response, $route, array('navigation' => $structure, 'content' => $contentHTML, 'item' => $item, 'breadcrumb' => $breadcrumb, 'settings' => $settings, 'title' => $title, 'description' => $description, 'base_url' => $base_url, 'image' => $firstImage ));
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{ content }}
|
||||
|
||||
</div>
|
||||
|
@@ -204,10 +204,6 @@ header p{
|
||||
font-size: 2.5em;
|
||||
font-weight: 700;
|
||||
}
|
||||
.cover .lead{
|
||||
font-size: 0.9em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.cover .lead a, a.readMore{
|
||||
display: inline-block;
|
||||
min-width: 100px;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
<h1>{{ }}</h1>
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{ content }}
|
||||
|
||||
|
Reference in New Issue
Block a user