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.
This commit is contained in:
Raphaël Droz
2019-01-09 17:05:32 -03:00
committed by Andy Miller
parent e8825beae5
commit f1363877d8

View File

@@ -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));
}
}