diff --git a/wp-thumbor.php b/wp-thumbor.php index 4805105..e0a02ac 100644 --- a/wp-thumbor.php +++ b/wp-thumbor.php @@ -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';