I have this code in a page that includes other files via GET request:
$page = strtolower($_GET['page']);
if(!$page or !$allow[$page] or $page == 'home') {
header("Location: home.php");
}
where $allow
is a hardcoded array which contains a list of the allowed strings that are valid files to be included. Am I missing something obvious which would allow some code injection or is this check good enough?