grav-plugin-api
grav-plugin-api copied to clipboard
fix: prevent pages using an invalid template
At the moment, you can make a PATCH
or POST
request and set a page to use a non-existent page template. This would cause a twig rendering error and break the page.
We should validate that the template can be used (based on the currently active theme?) when attempting to change this, and throw a 400 Bad Request
if the new template is invalid.