mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 08:55:36 +02:00
Merge branch 'feature/autoescape' into develop
# Conflicts: # themes/grav/css-compiled/template.css # themes/grav/css-compiled/template.css.map
This commit is contained in:
@@ -242,6 +242,13 @@ class AdminPlugin extends Plugin
|
||||
{
|
||||
// Only activate admin if we're inside the admin path.
|
||||
if ($this->active) {
|
||||
|
||||
// Turn on Twig autoescaping
|
||||
if (method_exists($this->grav['twig'], 'setAutoescape')) {
|
||||
$this->grav['twig']->setAutoescape(true);
|
||||
}
|
||||
|
||||
|
||||
if (php_sapi_name() == 'cli-server') {
|
||||
throw new \RuntimeException('The Admin Plugin cannot run on the PHP built-in webserver. It needs Apache, Nginx or another full-featured web server.', 500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user