From bf5287f762995c6060d2b4bc3d311c14363850a7 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 3 May 2021 14:55:48 -0600 Subject: [PATCH 1/4] removed the windows \r\n line breaks + extraneous escaping --- CHANGELOG.md | 6 ++++++ templates/forms/default/data.txt.twig | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ad9a43..36ad12b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v5.0.3 +## mm/dd/2021 + +1. [](#improved) + * Removed the windows `\r\n` line breaks + extraneous escaping in `data.txt.twig` + # v5.0.2 ## 04/23/2021 diff --git a/templates/forms/default/data.txt.twig b/templates/forms/default/data.txt.twig index 7758ad55..27aa87bc 100644 --- a/templates/forms/default/data.txt.twig +++ b/templates/forms/default/data.txt.twig @@ -9,7 +9,7 @@ {%- if show_field %} {%- set value = form.value(scope ~ (field.name ?? index)) -%} {%- if value -%} - {{- field.label|t|e }}: {{ string(value is iterable ? value|json_encode : value|escape('yaml')) ~ "\r\n" }} + {{- field.label|t|e }}: {{ string(value is iterable ? value|json_encode : value) ~ "\n" }} {%- endif -%} {%- endif %} {%- endif %} @@ -17,5 +17,5 @@ {%- endmacro %} {%- import _self as macro %} {%- autoescape false %} -{{- macro.render_field(form, form.fields, '') ~ "\r\n" }} -{%- endautoescape %} +{{- macro.render_field(form, form.fields, '') ~ "\n" }} +{%- endautoescape %} \ No newline at end of file From d53d3124481c8a72f223c49a03e6fd9b1f5bd7ee Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 13 May 2021 12:50:26 -0600 Subject: [PATCH 2/4] Use base64_encode filter rather than function --- templates/forms/fields/file/file.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/forms/fields/file/file.html.twig b/templates/forms/fields/file/file.html.twig index 889caa45..9f6094f5 100644 --- a/templates/forms/fields/file/file.html.twig +++ b/templates/forms/fields/file/file.html.twig @@ -32,17 +32,17 @@ {% if type == 'pages' %} {% set blueprint_name = type ~ '/' ~ blueprint_name %} {% endif %} - {% set blueprint = base64_encode(blueprint_name) %} + {% set blueprint = blueprint_name|base64_encode %} {% set real_path = value.thumb ?? global.context.media[path].relativePath ?? global.form.getPagePathFromToken(path) %} {% set remove = global.form.getFileDeleteAjaxRoute(files.name, path)|string ?: uri.addNonce( global.base_url_relative ~ '/media.json' ~ '/task' ~ config.system.param_sep ~ 'removeFileFromBlueprint' ~ - '/proute' ~ config.system.param_sep ~ base64_encode(route) ~ + '/proute' ~ config.system.param_sep ~ route|base64_encode ~ '/blueprint' ~ config.system.param_sep ~ blueprint ~ '/type' ~ config.system.param_sep ~ type ~ '/field' ~ config.system.param_sep ~ files.name ~ - '/path' ~ config.system.param_sep ~ base64_encode(value.path), 'admin-form', 'admin-nonce') %} + '/path' ~ config.system.param_sep ~ value.path|base64_encode, 'admin-form', 'admin-nonce') %} {% set file = value|merge({remove: remove, path: value.thumb_url ?? (uri.rootUrl == '/' ? '/' : uri.rootUrl ~ '/' ~ real_path) }) %} From af8ccef0cf5384ddc9a0eaaf112599a83d38e848 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 10 Jun 2021 09:41:25 +0300 Subject: [PATCH 3/4] Composer update --- composer.lock | 6 +++--- vendor/composer/InstalledVersions.php | 4 ++-- vendor/composer/installed.json | 2 +- vendor/composer/installed.php | 4 ++-- vendor/composer/platform_check.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 80fbb205..23aa5293 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "81d3cf2a625490c40f3f023c7810fb0e", + "content-hash": "e0e2ccc2fca6a3cb5d548cf61bb80f66", "packages": [ { "name": "google/recaptcha", @@ -66,12 +66,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1.3", + "php": "^7.3.6 || ^8.0", "ext-json": "*" }, "platform-dev": [], "platform-overrides": { - "php": "7.1.3" + "php": "7.3.6" }, "plugin-api-version": "2.0.0" } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index c8f1873a..8fa1be5f 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -29,7 +29,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => '3eabc541329e2fc0b9fc2f23e5d5c58d5f0dbc15', + 'reference' => 'd53d3124481c8a72f223c49a03e6fd9b1f5bd7ee', 'name' => 'getgrav/grav-plugin-form', ), 'versions' => @@ -41,7 +41,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => '3eabc541329e2fc0b9fc2f23e5d5c58d5f0dbc15', + 'reference' => 'd53d3124481c8a72f223c49a03e6fd9b1f5bd7ee', ), 'google/recaptcha' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index af9c6a10..1c15bb95 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -56,6 +56,6 @@ "install-path": "../google/recaptcha" } ], - "dev": true, + "dev": false, "dev-package-names": [] } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a465c2d1..c8a26bc5 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => '3eabc541329e2fc0b9fc2f23e5d5c58d5f0dbc15', + 'reference' => 'd53d3124481c8a72f223c49a03e6fd9b1f5bd7ee', 'name' => 'getgrav/grav-plugin-form', ), 'versions' => @@ -18,7 +18,7 @@ 'aliases' => array ( ), - 'reference' => '3eabc541329e2fc0b9fc2f23e5d5c58d5f0dbc15', + 'reference' => 'd53d3124481c8a72f223c49a03e6fd9b1f5bd7ee', ), 'google/recaptcha' => array ( diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index cd1bd2c5..01091250 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70103)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.3". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70306)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.6". You are running ' . PHP_VERSION . '.'; } if ($issues) { From 48678f9caf600f8a46249950c41b4e2a7fd38ff5 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 15 Jun 2021 13:06:01 -0600 Subject: [PATCH 4/4] prepare for release --- CHANGELOG.md | 3 ++- blueprints.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36ad12b1..57d3c3d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # v5.0.3 -## mm/dd/2021 +## 05/15/2021 1. [](#improved) * Removed the windows `\r\n` line breaks + extraneous escaping in `data.txt.twig` + * Use base64_encode filter rather than function # v5.0.2 ## 04/23/2021 diff --git a/blueprints.yaml b/blueprints.yaml index be5b4ad5..da578bca 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Form slug: form type: plugin -version: 5.0.2 +version: 5.0.3 description: Enables the forms handling icon: check-square author: