fix: hashmac
This commit is contained in:
@@ -240,7 +240,8 @@ function wp_thumbor_transform_url($url, $width = null, $height = null) {
|
||||
// Détermine l'endpoint : si une clé secrète est renseignée, on signe, sinon on utilise "unsafe"
|
||||
if ( ! empty($options['thumbor_secret_key']) ) {
|
||||
$hmac = hash_hmac('sha1', $path_to_sign, $options['thumbor_secret_key'], true);
|
||||
$encoded_signature = strtr(base64_encode($hmac), '+/', '-_');
|
||||
// on enlève aussi les '=' de padding pour que Thumbor accepte la signature
|
||||
$encoded_signature = rtrim(strtr(base64_encode($hmac), '+/', '-_'), '=');
|
||||
$endpoint = $encoded_signature;
|
||||
} else {
|
||||
$endpoint = 'unsafe';
|
||||
|
||||
Reference in New Issue
Block a user