From 4420e9662da861348cdc661e8c1337d29fde3a14 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 23 Aug 2023 10:15:31 -0600 Subject: [PATCH] Load anonymous user's lang preference for error translation --- api/src/Sharing.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/Sharing.php b/api/src/Sharing.php index 76c8c24d1f..0e7234c5c3 100644 --- a/api/src/Sharing.php +++ b/api/src/Sharing.php @@ -208,6 +208,11 @@ class Sharing } } + // Load lang preference for error translations + if(empty($GLOBALS['egw_info']['user']['preferences']['common']['lang'])) + { + $GLOBALS['egw_info']['user']['preferences'] = (new Preferences(Accounts::id2name('anonymous', 'account_id')))->read(); + } if (empty($token) || !($share = self::$db->select(self::TABLE, '*', array( 'share_token' => $token, '(share_expires IS NULL OR share_expires > '.self::$db->quote(time(), 'date').')',