diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-06-16 12:36:58 -0700 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-06-16 12:36:58 -0700 |
commit | 06f8cfbed961eb9394fa29558dd29c79f87fc9ad (patch) | |
tree | 20b02ae07d943248a0a01191409cd02120e5fcb3 /inc/fetch.functions.php | |
parent | d6b7a2dd189b692f9a754f4f1a330abe6449669a (diff) | |
parent | b9ee6a44e7499b5c2e9f117096cedc769ef2e25d (diff) | |
download | rpg-06f8cfbed961eb9394fa29558dd29c79f87fc9ad.tar.gz rpg-06f8cfbed961eb9394fa29558dd29c79f87fc9ad.tar.bz2 |
Merge pull request #225 from splitbrain/fetchftp
Add media_isexternal
Diffstat (limited to 'inc/fetch.functions.php')
-rw-r--r-- | inc/fetch.functions.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php index ea524a37a..53ade3555 100644 --- a/inc/fetch.functions.php +++ b/inc/fetch.functions.php @@ -89,15 +89,18 @@ function sendFile($file, $mime, $dl, $cache, $public = false) { * WRITE: MEDIA, FILE, array( STATUS, STATUSMESSAGE ) * * @author Gerry Weissbach <gerry.w@gammaproduction.de> - * @param $media reference to the media id - * @param $file reference to the file variable - * @returns array(STATUS, STATUSMESSAGE) + * @param string $media reference to the media id + * @param string $file reference to the file variable + * @param string $rev + * @param int $width + * @param int $height + * @return array(STATUS, STATUSMESSAGE) */ function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) { global $MIME, $EXT, $CACHE, $INPUT; //media to local file - if(preg_match('#^(https?)://#i', $media)) { + if(media_isexternal($media)) { //check hash if(substr(PassHash::hmac('md5', $media, auth_cookiesalt()), 0, 6) !== $INPUT->str('hash')) { return array(412, 'Precondition Failed'); |