reverted changes
This commit is contained in:
@@ -240,8 +240,7 @@ 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);
|
||||
// on enlève aussi les '=' de padding pour que Thumbor accepte la signature
|
||||
$encoded_signature = rtrim(strtr(base64_encode($hmac), '+/', '-_'), '=');
|
||||
$encoded_signature = strtr(base64_encode($hmac), '+/', '-_');
|
||||
$endpoint = $encoded_signature;
|
||||
} else {
|
||||
$endpoint = 'unsafe';
|
||||
@@ -298,15 +297,7 @@ function wp_thumbor_output_buffer_callback($buffer) {
|
||||
foreach ( $srcsetItems as $item ) {
|
||||
$parts = preg_split('/\s+/', trim($item));
|
||||
if ( ! empty($parts[0]) && preg_match('/^https?:\/\//', $parts[0]) ) {
|
||||
$width = null;
|
||||
$height = null;
|
||||
if ( isset($parts[1]) && preg_match('/^(\d+)w$/i', $parts[1], $m) ) {
|
||||
$width = intval($m[1]);
|
||||
} elseif ( isset($parts[1]) && preg_match('/^(\d+)h$/i', $parts[1], $m) ) {
|
||||
$height = intval($m[1]);
|
||||
}
|
||||
$newURL = wp_thumbor_transform_url($parts[0], $width, $height);
|
||||
|
||||
$newURL = wp_thumbor_transform_url($parts[0]);
|
||||
$newSrcset[] = isset($parts[1]) ? $newURL . ' ' . $parts[1] : $newURL;
|
||||
} else {
|
||||
$newSrcset[] = $item;
|
||||
|
||||
Reference in New Issue
Block a user