When decompressing compressed messages, dont barf if we try to decompress the same attribute twice
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 39s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m47s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2024-05-13 15:29:29 +10:00
parent b008cb20d2
commit 6c7da7a220

View File

@ -28,7 +28,13 @@ class CompressedString implements CastsAttributes
? stream_get_contents($value)
: $value;
return $value ? zstd_uncompress(base64_decode($value)) : '';
// If we get an error decompressing, it might not be zstd (or its already been done)
try {
return $value ? zstd_uncompress(base64_decode($value)) : '';
} catch (\ErrorException $e) {
return $value;
}
}
/**