diff --git a/imagecache.module b/imagecache.module index e545498..5b05924 100644 --- a/imagecache.module +++ b/imagecache.module @@ -400,7 +400,7 @@ function imagecache_create_url($presetname, $filepath, $bypass_browser_cache = F function imagecache_style_path_token($presetname, $path) { // Drupal 6 may not yet have drupal_get_hash_salt(). global $db_query; - $salt = hash('sha256', serialize($db_query)); + $salt = sha1(serialize($db_query)); // Return the first eight characters. return substr(_imagecache_hmac_base64($presetname . ':' . $path, drupal_get_private_key() . $salt), 0, 8); } @@ -418,7 +418,7 @@ function _imagecache_hmac_base64($data, $key) { $ipad = $ipad ^ $key; $opad = $opad ^ $key; - $hmac = base64_encode(sha1($opad . pack("H*", sha1($ipad . $data)))); + $hmac = base64_encode(pack("H*", sha1($opad . pack("H*", sha1($ipad . $data))))); // Modify the hmac so it's safe to use in URLs. return strtr($hmac, array('+' => '-', '/' => '_', '=' => '')); }