From 0a2029172f535e4dfa258b8fe96e457c865cf18d Mon Sep 17 00:00:00 2001 From: Klap-in Date: Tue, 21 May 2013 12:36:45 +0200 Subject: Support handle of images from ftp. ml() can built url to these images, either fetch didn't accept them. --- inc/fetch.functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/fetch.functions.php') diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php index 5801e96fa..b85a1284f 100644 --- a/inc/fetch.functions.php +++ b/inc/fetch.functions.php @@ -97,7 +97,7 @@ 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(preg_match('#^(https?|ftp)://#i', $media)) { //check hash if(substr(md5(auth_cookiesalt().$media), 0, 6) !== $INPUT->str('hash')) { return array(412, 'Precondition Failed'); -- cgit v1.2.3 From f481fb8c448406f875dbf08e2aaa94a59e3b0f93 Mon Sep 17 00:00:00 2001 From: Klap-in Date: Tue, 21 May 2013 12:41:02 +0200 Subject: Update phpdocs of checkFileStatus --- inc/fetch.functions.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'inc/fetch.functions.php') diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php index b85a1284f..56ca75465 100644 --- a/inc/fetch.functions.php +++ b/inc/fetch.functions.php @@ -89,9 +89,12 @@ function sendFile($file, $mime, $dl, $cache, $public = false) { * WRITE: MEDIA, FILE, array( STATUS, STATUSMESSAGE ) * * @author Gerry Weissbach - * @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; -- cgit v1.2.3 From 3e7e6067571e660cd835164c22d0973aa6343408 Mon Sep 17 00:00:00 2001 From: Klap-in Date: Tue, 21 May 2013 22:52:10 +0200 Subject: apply media_isexternal --- inc/fetch.functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/fetch.functions.php') diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php index 56ca75465..e78bbf103 100644 --- a/inc/fetch.functions.php +++ b/inc/fetch.functions.php @@ -100,7 +100,7 @@ function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) { global $MIME, $EXT, $CACHE, $INPUT; //media to local file - if(preg_match('#^(https?|ftp)://#i', $media)) { + if(media_isexternal($media)) { //check hash if(substr(md5(auth_cookiesalt().$media), 0, 6) !== $INPUT->str('hash')) { return array(412, 'Precondition Failed'); -- cgit v1.2.3