Created
August 7, 2011 16:37
-
-
Save kopiro/1130511 to your computer and use it in GitHub Desktop.
Protect PHP download modules
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 | |
$u = $_GET["file"]; | |
$u = realpath($u); | |
$safedir = realpath("./music/"); | |
if (substr($u, 0, strlen($safedir))!=$safedir) die("Error"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment