Revert changes to CompressedString::class, messages were going out base64 encoded and compressed
This commit is contained in:
parent
01107cd3dc
commit
713615d8d5
@ -4,7 +4,6 @@ namespace App\Casts;
|
|||||||
|
|
||||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Arr;
|
|
||||||
|
|
||||||
class CompressedString implements CastsAttributes
|
class CompressedString implements CastsAttributes
|
||||||
{
|
{
|
||||||
@ -21,11 +20,6 @@ class CompressedString implements CastsAttributes
|
|||||||
*/
|
*/
|
||||||
public function get($model,string $key,mixed $value,array $attributes): string
|
public function get($model,string $key,mixed $value,array $attributes): string
|
||||||
{
|
{
|
||||||
static $converted = [];
|
|
||||||
|
|
||||||
if (Arr::get($converted,$key))
|
|
||||||
return $value;
|
|
||||||
|
|
||||||
// For stream resources, we to fseek in case we've already read it.
|
// For stream resources, we to fseek in case we've already read it.
|
||||||
if (is_resource($value))
|
if (is_resource($value))
|
||||||
fseek($value,0);
|
fseek($value,0);
|
||||||
@ -34,8 +28,6 @@ class CompressedString implements CastsAttributes
|
|||||||
? stream_get_contents($value)
|
? stream_get_contents($value)
|
||||||
: $value;
|
: $value;
|
||||||
|
|
||||||
$converted[$key] = TRUE;
|
|
||||||
|
|
||||||
return $value ? zstd_uncompress(base64_decode($value)) : '';
|
return $value ? zstd_uncompress(base64_decode($value)) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user