Active
Project:
Views PHP
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2014 at 19:49 UTC
Updated:
8 Feb 2021 at 23:37 UTC
Jump to comment: Most recent
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.
| Comment | File | Size | Author |
|---|---|---|---|
| 0001-adding-linting-option-to-option-form-submission.patch | 10.96 KB | elephant.jim |
Comments
Comment #1
elephant.jim commentedFWIW, it looks like this patch will work without modification on 7.x-2.x-dev.
Comment #2
liam morland