Created
July 3, 2012 08:57
-
-
Save uzulla/3038607 to your computer and use it in GitHub Desktop.
Proxy get
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 | |
$url = $_GET['u']; | |
if( preg_match('/^http:\/\/[a-zA-Z0-9]{1,5}.twimg.com/',$url) ){ | |
$img = file_get_contents($url); | |
foreach($http_response_header as $head){ | |
if(preg_match('/^Content-Type/',$head)){ | |
header($head); | |
break; | |
} | |
} | |
echo $img; | |
}else{ | |
echo 'invalid url'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment