diff --git a/imagecache.module b/imagecache.module index aa63b66..a22eade 100644 --- a/imagecache.module +++ b/imagecache.module @@ -399,16 +399,10 @@ 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 $databases; - $salt = hash('sha256', serialize($databases)); + global $db_url; + $salt = hash('sha256', serialize($db_url)); // Return the first eight characters. - return substr(_imagecache_hmac_base64($presetname . ':' . $path, drupal_get_private_key() . $salt), 0, 8); -} - -function _imagecache_hmac_base64($data, $key) { - $hmac = base64_encode(hash_hmac('sha256', $data, $key, TRUE)); - // Modify the hmac so it's safe to use in URLs. - return strtr($hmac, array('+' => '-', '/' => '_', '=' => '')); + return substr(sha1($presetname . ':' . $path . drupal_get_private_key() . $salt), 0, 8); } /**