From 3faeaf15852037e5d0e351fb3560d58fd09af522 Mon Sep 17 00:00:00 2001 From: James Hunt <10615884+thetwopct@users.noreply.github.com> Date: Thu, 30 Sep 2021 10:27:06 +0700 Subject: [PATCH] Stop JSON data new_value being saved with slashes I'm keeping track of a JSON array, and I noticed the new_value was being saved with slashes This fixes that issue. --- src/Venturecraft/Revisionable/RevisionableTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Venturecraft/Revisionable/RevisionableTrait.php b/src/Venturecraft/Revisionable/RevisionableTrait.php index 0def63f..e04a805 100644 --- a/src/Venturecraft/Revisionable/RevisionableTrait.php +++ b/src/Venturecraft/Revisionable/RevisionableTrait.php @@ -193,7 +193,7 @@ public function postSave() 'revisionable_id' => $this->getKey(), 'key' => $key, 'old_value' => Arr::get($this->originalData, $key), - 'new_value' => $this->updatedData[$key], + 'new_value' => stripslashes($this->updatedData[$key]), 'user_id' => $this->getSystemUserId(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(),