From f1363877d8782fbceb4dd53d38d538f57b7104de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= Date: Wed, 9 Jan 2019 17:05:32 -0300 Subject: [PATCH] preserve accents in fields containing Twig expr. using unicode (#2279) When a fields contain accentuated characters, reduce the risk of messing with it by passing unicode characters unescaped. Twig will deal with them. And fewer backslash-escaping problems will arise. --- system/src/Grav/Common/Page/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 3024cc394..0e57b0344 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -168,7 +168,7 @@ class Page implements PageInterface unset($process_fields[$field]); } } - $text_header = Grav::instance()['twig']->processString(json_encode($process_fields), ['page' => $this]); + $text_header = Grav::instance()['twig']->processString(json_encode($process_fields, JSON_UNESCAPED_UNICODE), ['page' => $this]); $this->header((object)(json_decode($text_header, true) + $ignored_fields)); } }