diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-05-21 12:06:16 +0200 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-05-21 12:06:16 +0200 |
commit | 826d276602b191ee09d3450f7a8f9476c0e787b1 (patch) | |
tree | 7b2e69652293b52d73207c9700b2dea8468b7bd1 /inc/common.php | |
parent | a07e7a4fb1edaeca6bb2cb537b368c31a580675c (diff) | |
download | rpg-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/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 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 = '&', $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(md5(auth_cookiesalt().$id), 0, 6); |