Created
October 15, 2018 17:43
-
-
Save Shaked/52521cdf99286f8e2c57a1a6d6dcd5de to your computer and use it in GitHub Desktop.
PHP Security Question - Is This Secure?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userRequest = $_GET['userRequest'] ?? null; | |
$path = 'file' . $userRequest; | |
if (file_exists($path)) { | |
require_once($path); | |
} else { | |
echo 'File does not exist'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment