Bad code in a views_php plugin can easily cause the entire site to crash. As a way to ameliorate this, I created a patch that runs the code through the PHP command line linter. At the very least, this catches basic syntax errors.

The patch adds a checkbox to each PHP entry asking if the user want to lint the code before submission. If checked, the code is run through the linter during form validation. If the code doesn't parse, form_set_error() is called. If a user really wants to submit code that won't parse, they can uncheck the option for the linter.

Comments

elephant.jim’s picture

FWIW, it looks like this patch will work without modification on 7.x-2.x-dev.

liam morland’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev