Source code analysis challenge

Let’s see who can find it :wink:

<?php

if (isset($_GET['page'])) {
	$page = $_GET['page'];
} else {
	$page = "home";
}

$file = "templates/" . $page . ".php";

// I heard '..' is dangerous!
assert("strpos('$file', '..') === false") or die("Detected hacking attempt!");

// TODO: Make this look nice
assert("file_exists('$file')") or die("That file doesn't exist!");

?>

/*
	HTML code here, nothing special, no logic...
*/

<div class="container" style="margin-top: 50px">
	<?php
		require_once $file;
	?>
	
</div>
1 Like

:grimacing::grimacing::grimacing:

:persevere::persevere:

1 Like

Page loading problem… :disappointed_relieved:

what is the solution?