From 0fbf1a38598b73fe5b3e67c9a10d098b21562238 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 17 Dec 2024 13:51:52 +0000 Subject: [PATCH] MDL-83474 webservice: fix empty/zero $itemid handling in text format. --- lib/external/classes/util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/external/classes/util.php b/lib/external/classes/util.php index d62ce8444d8a9..8c63a763ebd73 100644 --- a/lib/external/classes/util.php +++ b/lib/external/classes/util.php @@ -543,8 +543,8 @@ public static function format_text( return ['', $textformat ?? FORMAT_MOODLE]; } - if (empty($itemid)) { - $itemid = null; + if ($itemid !== null) { + $itemid = (int) $itemid; } // Get settings (singleton).