I've been working on an application that will allow for third-party extensions to be built to expand the application's functionality. All this in PHP, of course. I wanted to add a bit of security padding by running files in a certain directory through a checksum function. If the file doesn't pass the checksum, the file isn't "included", the administrator for that installation is notified, and the module is disabled until the administrator acts (re-enables and records the exception, or reinstalls the module).
The problem I'm having right now is being able to run that checksum whenever a user runs the include()
function. I'd rather not have them run two functions back to back just to include a file, but if I have to I will. Not all third-party extensions will be very willing to run two functions (something like if(checksum_function($bleh)) include($bleh);
), and even if they were, it'd be so much easier (and more secure) to run the checksum whenever include()
is executed, instead of doubling the line count for include()
statements.
I've done some searching around and haven't found much. Ideas? Thanks in advance!