Hi there everyone!
For an explanation of my efforts, I do my best to suppress user notification of error. With the efforts of the dirty weasels in trying to find vulnerabilities, I don't want to make it any easier on them. For that reason, I often report a unique identifier that I can then do a search for in the code to find what's causing the issue.
do_this or die("Superbad error 472");
This has worked well for me . There's one thing I can't figure out however and that's how to handle it with an include. I thought it would be handy to make my own include function, allowing me to report the error to me and then kill the script generation on the user's end, but ran into a hiccup:
function includier($includedFile){
if(is_readable($includedFile)) {
include($includedFile);
}else{
//report then die.
die(Killed it!');
}
}
I'm sure you guys already know what it took me a while to figure out, that being that it's not carrying over all the variables in the included page. It seems from my Googling that I would need to set all the variables in the included page as $global. That takes this function out of the running for a feasible solution.
Is there a way I could modify this function to do what I would like or will I need to use the code in every instance that I will be including a file?
Thanks for your time!