From 4387dcda7a9925810005c4b9ad19b4bc2d6fff22 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 18 Jan 2024 14:41:03 +0100 Subject: [PATCH] =?UTF-8?q?Compresse=20les=20fichiers=20de=20donn=C3=A9es?= =?UTF-8?q?=20Corrige=20un=20probl=C3=A8me=20dans=20la=20fonction=20getCou?= =?UTF-8?q?rsesByUser=20lorsque=20le=20membre=20a=20un=20r=C3=B4le=20inf?= =?UTF-8?q?=C3=A9rieur=20=C3=A0=20EDITOR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/jsondb/JsonDb.class.php | 2 +- core/core.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/class/jsondb/JsonDb.class.php b/core/class/jsondb/JsonDb.class.php index 8344c04..57278c8 100644 --- a/core/class/jsondb/JsonDb.class.php +++ b/core/class/jsondb/JsonDb.class.php @@ -143,7 +143,7 @@ class JsonDb extends \Prowebcraft\Dot public function save() { //$v = json_encode($this->data, JSON_UNESCAPED_UNICODE ); - $v = json_encode($this->data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT); + $v = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT); $l = strlen($v); $t = 0; while ($t < 5) { diff --git a/core/core.php b/core/core.php index 1f2155e..dc22b42 100644 --- a/core/core.php +++ b/core/core.php @@ -1438,8 +1438,8 @@ class common case self::GROUP_MEMBER: case self::GROUP_VISITOR: foreach ($c as $courseId => $value) { - $students = $this->getData(['enrolment', $courseId, 'students']); - if (in_array($userId, $students) === false) { + $students = $this->getData(['enrolment', $courseId]); + if (is_array($students[$userId]) === false) { unset($c[$courseId]); } }