diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-08-03 10:44:54 +0200 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-08-03 10:44:54 +0200 |
commit | 6acfab8732e1784b953c8cc2ae7408f84fda7ce8 (patch) | |
tree | 01e6ac38df46c9ad18f058c8d597617702eb67f3 /inc/common.php | |
parent | 51bd6f039e782dca456022514893aa80bd7c52b9 (diff) | |
parent | cab505616ec9b8ef3cd671e7337c91d065745932 (diff) | |
download | rpg-6acfab8732e1784b953c8cc2ae7408f84fda7ce8.tar.gz rpg-6acfab8732e1784b953c8cc2ae7408f84fda7ce8.tar.bz2 |
Merge remote-tracking branch 'origin/master' into changelogtestsonly
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/inc/common.php b/inc/common.php index 1b4d9e8e4..3312141c8 100644 --- a/inc/common.php +++ b/inc/common.php @@ -148,7 +148,7 @@ function pageinfo() { $info['id'] = $ID; $info['rev'] = $REV; - if(isset($_SERVER['REMOTE_USER'])) {
+ if(isset($_SERVER['REMOTE_USER'])) { $sub = new Subscription(); $info['subscribed'] = $sub->user_subscription(); } else { @@ -474,7 +474,7 @@ function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false) if(is_array($more)) { // add token for resized images - if($more['w'] || $more['h']){ + if($more['w'] || $more['h'] || $isexternalimage){ $more['tok'] = media_get_token($id,$more['w'],$more['h']); } // strip defaults for shorter URLs @@ -485,12 +485,13 @@ function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false) $more = buildURLparams($more, $sep); } else { $matches = array(); - if (preg_match_all('/\b(w|h)=(\d*)\b/',$more,$matches,PREG_SET_ORDER)){ + if (preg_match_all('/\b(w|h)=(\d*)\b/',$more,$matches,PREG_SET_ORDER) || $isexternalimage){ $resize = array('w'=>0, 'h'=>0); foreach ($matches as $match){ $resize[$match[1]] = $match[2]; } - $more .= $sep.'tok='.media_get_token($id,$resize['w'],$resize['h']); + $more .= $more === '' ? '' : $sep; + $more .= 'tok='.media_get_token($id,$resize['w'],$resize['h']); } $more = str_replace('cache=cache', '', $more); //skip default $more = str_replace(',,', ',', $more); @@ -506,14 +507,8 @@ function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false) // external URLs are always direct without rewriting if($isexternalimage) { $xlink .= 'lib/exe/fetch.php'; - // add hash: - $xlink .= '?hash='.substr(PassHash::hmac('md5', $id, auth_cookiesalt()), 0, 6); - if($more) { - $xlink .= $sep.$more; - $xlink .= $sep.'media='.rawurlencode($id); - } else { - $xlink .= $sep.'media='.rawurlencode($id); - } + $xlink .= '?'.$more; + $xlink .= $sep.'media='.rawurlencode($id); return $xlink; } @@ -1130,7 +1125,7 @@ function saveWikiText($id, $text, $summary, $minor = false) { // if useheading is enabled, purge the cache of all linking pages if(useHeading('content')) { - $pages = ft_backlinks($id); + $pages = ft_backlinks($id, true); foreach($pages as $page) { $cache = new cache_renderer($page, wikiFN($page), 'xhtml'); $cache->removeCache(); |