Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // You can modify the second value to change the fallback page (eg., you could make it redirect to an error page).
- define("FALLBACK_PAGE", "news_en.php");
- /// secure_include
- /// string $file : file to include
- /// If the given $file is not in the working directory, includes FALLBACK_PAGE. Else, includes $file.
- function secure_include($file)
- {
- addslashes($file);
- if($file == 'div_en.php' || $file == 'div.php' || !in_array($file, scandir(getcwd())))
- include(FALLBACK_PAGE);
- else
- include($file);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment