summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php
index 55c5b5ac4..59ceb0c0d 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -435,6 +435,11 @@ function exportlink($id = '', $format = 'raw', $more = '', $abs = false, $sep =
*/
function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false) {
global $conf;
+ $isexternalimage = preg_match('#^(https?|ftp)://#i', $id);
+ if(!$isexternalimage) {
+ $id = cleanID($id);
+ }
+
if(is_array($more)) {
// add token for resized images
if($more['w'] || $more['h']){
@@ -467,7 +472,7 @@ function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false)
}
// external URLs are always direct without rewriting
- if(preg_match('#^(https?|ftp)://#i', $id)) {
+ if($isexternalimage) {
$xlink .= 'lib/exe/fetch.php';
// add hash:
$xlink .= '?hash='.substr(PassHash::hmac('md5', $id, auth_cookiesalt()), 0, 6);