Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thoughts on having a whitelist? #86

Open
jamesshannon opened this issue Dec 30, 2013 · 0 comments
Open

Thoughts on having a whitelist? #86

jamesshannon opened this issue Dec 30, 2013 · 0 comments

Comments

@jamesshannon
Copy link

Hi. I use concrete5, which probably has more "minor code errors" than wordpress (in fact, I see you have a "sloppy concrete5" option).

However, when I'm developing, I want my sloppiness to be called out.

I think there are two ways of doing this, and I'd like to hear your thoughts. One is to whitelist the entire core directory, which should be easy enough. Only my custom code will get "handled" by php error, and everything else can be discarded, or only sent to the log. (When I say discarded, I mean the types of errors that would otherwise not be reported at all (E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED)).

However, I see two problems. One of which is that I might use an API call incorrectly which causes an notice/warning to get called (though I guess you can look at the entire trace). The other of which is that this doesn't allow for development of the core (or at least keeping me honest). All in all, whitelisting the core directory seems a bit sloppy.

The alternative is to build a whitelist of known and "accepted" errors. You can put php error in "learning mode" and click around on a freshly installed site and it'll log all error signatures (code, line, and file, maybe for the next on the stack, too), and create a hash which, if matched, gets skipped. Alternatively (or in addition), you can choose to permanently silence an error that's thrown (through some link, which adds to the whitelist.

Thoughts? Any novel approach that you'd recommend?

James

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant