Created
March 7, 2018 14:11
-
-
Save jcarlosroldan/1a7f86f1ece7ad972c5c120e5cc42c03 to your computer and use it in GitHub Desktop.
Simple and safe script to bypass hotlinking protection
This file contains 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 | |
$salt = "change_me"; | |
if (isset($_REQUEST["u"]) && isset($_REQUEST["k"]) && md5($_REQUEST["u"] . $salt) == $_REQUEST["k"]) { | |
$file_info = new finfo(FILEINFO_MIME_TYPE); | |
$res = file_get_contents($_REQUEST["u"]); | |
$mime_type = $file_info->buffer($res); | |
header('Content-type: '.$mime_type); | |
echo $res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use it on my shared hosting to download files