mirror of
https://github.com/getgrav/grav.git
synced 2026-07-10 17:53:28 +02:00
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:
committed by
Andy Miller
parent
e8825beae5
commit
f1363877d8
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user