From 22be89a9f2e25141a76b9807e76f62137c4d8732 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 16 Oct 2020 13:58:09 +0300 Subject: [PATCH 1/4] Use return type hints in plugin --- components/plugin/blank/plugin.php.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/plugin/blank/plugin.php.twig b/components/plugin/blank/plugin.php.twig index 99ae2bf..284110b 100644 --- a/components/plugin/blank/plugin.php.twig +++ b/components/plugin/blank/plugin.php.twig @@ -20,7 +20,7 @@ class {{ component.name|camelize }}Plugin extends Plugin * callable (or function) as well as the priority. The * higher the number the higher the priority. */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ 'onPluginsInitialized' => [ @@ -43,7 +43,7 @@ class {{ component.name|camelize }}Plugin extends Plugin /** * Initialize the plugin */ - public function onPluginsInitialized() + public function onPluginsInitialized(): void { // Don't proceed if we are in the admin plugin if ($this->isAdmin()) { From 70d9d2d75605ca998349149ed409b066433c433d Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 16 Oct 2020 13:59:02 +0300 Subject: [PATCH 2/4] Changelog update --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5884aa9..ab6e0f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.4.2 +## mm/dd/2020 + +1. [](#improved) + * User return typehints in plugin.php + # v1.4.1 ## 05/20/2020 From d7d847d095965f93d720d4e9eb13827975a107d0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 16 Oct 2020 14:10:26 +0300 Subject: [PATCH 3/4] Add proper twig escapes into a new theme --- CHANGELOG.md | 1 + .../pure-blank/templates/default.html.twig | 2 +- .../pure-blank/templates/error.html.twig | 2 +- .../templates/partials/base.html.twig | 14 ++++----- .../templates/partials/navigation.html.twig | 31 +++++++++---------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6e0f0..49cb29e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#improved) * User return typehints in plugin.php + * Add proper twig escapes into a new theme # v1.4.1 ## 05/20/2020 diff --git a/components/theme/pure-blank/templates/default.html.twig b/components/theme/pure-blank/templates/default.html.twig index 4dd67b6..1e97738 100644 --- a/components/theme/pure-blank/templates/default.html.twig +++ b/components/theme/pure-blank/templates/default.html.twig @@ -1,5 +1,5 @@ {% extends 'partials/base.html.twig' %} {% block content %} - {{ page.content }} + {{ page.content|raw }} {% endblock %} diff --git a/components/theme/pure-blank/templates/error.html.twig b/components/theme/pure-blank/templates/error.html.twig index f23aa78..c945464 100644 --- a/components/theme/pure-blank/templates/error.html.twig +++ b/components/theme/pure-blank/templates/error.html.twig @@ -3,6 +3,6 @@ {% block content %}

Error!

- {{ page.content }} + {{ page.content|raw }}
{% endblock %} diff --git a/components/theme/pure-blank/templates/partials/base.html.twig b/components/theme/pure-blank/templates/partials/base.html.twig index f7d9ee3..d31a436 100644 --- a/components/theme/pure-blank/templates/partials/base.html.twig +++ b/components/theme/pure-blank/templates/partials/base.html.twig @@ -1,17 +1,17 @@ {% set theme_config = attribute(config.themes, config.system.pages.theme) %} - + {% block head %} - {% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }} + {% if header.title %}{{ header.title|e }} | {% endif %}{{ site.title|e }} {% include 'partials/metadata.html.twig' %} - - + + {% endblock head %} {% block stylesheets %} @@ -29,14 +29,14 @@ {{ assets.js()|raw }} {% endblock %} - + {% block header %}
- {% block header_navigation %}