diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-06-08 12:36:08 -0700 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-06-08 12:36:08 -0700 |
commit | a0376fb908efe76fcdeca5132e5aab8b0412c84a (patch) | |
tree | 14ec37075d19eea80399fe72181e9a02f8b35502 /inc/common.php | |
parent | 04e4890db370bdb57201f76581fe3dc0a3adb614 (diff) | |
parent | dcb2204bf0a8e3e25bf4ff8352a71160e846266b (diff) | |
download | rpg-a0376fb908efe76fcdeca5132e5aab8b0412c84a.tar.gz rpg-a0376fb908efe76fcdeca5132e5aab8b0412c84a.tar.bz2 |
Merge pull request #223 from splitbrain/rootids_in_ml
Clean internal ids in ml(), that it matches with fetch.php
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 7 |
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); |