diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-06-09 22:21:37 +0200 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-06-09 22:21:37 +0200 |
commit | 3faed524fdb5c7c51a60a92e9715dd5425389c35 (patch) | |
tree | b37b25628bdf2fde079c4f2800d2fc118d726d0e /inc/media.php | |
parent | 3e7e6067571e660cd835164c22d0973aa6343408 (diff) | |
parent | 62765857f84626449d6c53b1a46c462a37e5083a (diff) | |
download | rpg-3faed524fdb5c7c51a60a92e9715dd5425389c35.tar.gz rpg-3faed524fdb5c7c51a60a92e9715dd5425389c35.tar.bz2 |
Merge remote-tracking branch 'origin/master' into fetchftp
Diffstat (limited to 'inc/media.php')
-rw-r--r-- | inc/media.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/inc/media.php b/inc/media.php index f3b1a0af5..fbe1363ec 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1891,20 +1891,21 @@ function media_crop_image($file, $ext, $w, $h=0){ * cropped images have been internally generated - and prevent external * DDOS attacks via fetch * + * @author Christopher Smith <chris@jalakai.co.uk> + * * @param string $id id of the image * @param int $w resize/crop width * @param int $h resize/crop height - * - * @author Christopher Smith <chris@jalakai.co.uk> + * @return string */ function media_get_token($id,$w,$h){ // token is only required for modified images if ($w || $h) { - $token = auth_cookiesalt().$id; + $token = $id; if ($w) $token .= '.'.$w; if ($h) $token .= '.'.$h; - return substr(md5($token),0,6); + return substr(PassHash::hmac('md5', $token, auth_cookiesalt()),0,6); } return ''; |