From 7f8d290022c87ec1601fc71417901b242ccead25 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 19 Jun 2023 12:52:51 +0100 Subject: [PATCH] MDL-78459 tool_mobile: use site context in mobile manifest file. Prevents debugging notices when the site shortname is formatted in the response data. --- admin/tool/mobile/mobile.webmanifest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/tool/mobile/mobile.webmanifest.php b/admin/tool/mobile/mobile.webmanifest.php index fd764578bfd..49dc9257f2e 100644 --- a/admin/tool/mobile/mobile.webmanifest.php +++ b/admin/tool/mobile/mobile.webmanifest.php @@ -31,7 +31,6 @@ define('NO_DEBUG_DISPLAY', true); define('NO_MOODLE_COOKIES', true); require_once(__DIR__ . '/../../../config.php'); -use tool_mobile\api; header('Content-Type: application/json; charset: utf-8'); @@ -41,7 +40,9 @@ if (!empty($CFG->enablemobilewebservice) && !empty($mobilesettings->enablesmarta !empty($mobilesettings->androidappid)) { $manifest = new StdClass; - $manifest->short_name = format_string($SITE->shortname); + $manifest->short_name = format_string($SITE->shortname, true, [ + 'context' => context_system::instance(), + ]); $manifest->prefer_related_applications = true; $manifest->icons = [(object) [