Skip to content

Commit

Permalink
preserve accents in fields containing Twig expr. using unicode (#2279)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Raphaël Droz authored and rhukster committed Jan 9, 2019
1 parent e8825be commit f136387
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected function processFrontmatter()
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));
}
}
Expand Down

0 comments on commit f136387

Please sign in to comment.