summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorKlap-in <klapinklapin@gmail.com>2013-05-21 12:06:16 +0200
committerKlap-in <klapinklapin@gmail.com>2013-05-21 12:06:16 +0200
commit826d276602b191ee09d3450f7a8f9476c0e787b1 (patch)
tree7b2e69652293b52d73207c9700b2dea8468b7bd1 /inc
parenta07e7a4fb1edaeca6bb2cb537b368c31a580675c (diff)
downloadrpg-826d276602b191ee09d3450f7a8f9476c0e787b1.tar.gz
rpg-826d276602b191ee09d3450f7a8f9476c0e787b1.tar.bz2
Clean internal ids in ml(), that it matches with fetch.php
The resize token was broken because fetch.php cleans the id before the token calculation, while ml() uses the raw id
Diffstat (limited to 'inc')
-rw-r--r--inc/common.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php
index 4d939ac77..03236f7d4 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 = '&amp;', $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 = '&amp;', $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(md5(auth_cookiesalt().$id), 0, 6);