diff --git a/src/GitList/Application.php b/src/GitList/Application.php index 7f7e2cd..99e97f8 100644 --- a/src/GitList/Application.php +++ b/src/GitList/Application.php @@ -48,6 +48,7 @@ class Application extends SilexApplication $this->register(new RoutingUtilServiceProvider()); $this['twig'] = $this->share($this->extend('twig', function($twig, $app) { + $twig->addFilter('htmlentities', new \Twig_Filter_Function('htmlentities')); $twig->addFilter('md5', new \Twig_Filter_Function('md5')); return $twig; diff --git a/views/file.twig b/views/file.twig index 8b530d2..71adbec 100644 --- a/views/file.twig +++ b/views/file.twig @@ -24,7 +24,7 @@
{{ blob }}
{% else %} -
{{ blob }}
+
{{ blob|htmlentities|raw }}
{% endif %}