From fde4e79ed0b851d0b7edfb44c0630cbf385f83cc Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 4 May 2023 19:48:09 +0200 Subject: SQL attributes native unicode (#5371) Save our attributes for entries, feeds, and tags as native Unicode instead of JSON escape sequences such as `\u00f8` which are difficult to work with. --- app/Models/EntryDAO.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 3ef3254b0..36d633c6e 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -169,7 +169,7 @@ SQL; $valuesTmp['attributes'] = []; } $this->addEntryPrepared->bindValue(':attributes', is_string($valuesTmp['attributes']) ? $valuesTmp['attributes'] : - json_encode($valuesTmp['attributes'], JSON_UNESCAPED_SLASHES)); + json_encode($valuesTmp['attributes'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); if (static::hasNativeHex()) { $this->addEntryPrepared->bindParam(':hash', $valuesTmp['hash']); @@ -280,7 +280,7 @@ SQL; $valuesTmp['attributes'] = []; } $this->updateEntryPrepared->bindValue(':attributes', is_string($valuesTmp['attributes']) ? $valuesTmp['attributes'] : - json_encode($valuesTmp['attributes'], JSON_UNESCAPED_SLASHES)); + json_encode($valuesTmp['attributes'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); if (static::hasNativeHex()) { $this->updateEntryPrepared->bindParam(':hash', $valuesTmp['hash']); -- cgit v1.2.3