MDL-78459 tool_mobile: use site context in mobile manifest file.

Prevents debugging notices when the site shortname is formatted in
the response data.
This commit is contained in:
Paul Holden 2023-06-19 12:52:51 +01:00
parent 1b1a15a308
commit 3af9bdfa7e
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -30,7 +30,6 @@
define('NO_DEBUG_DISPLAY', true);
require_once(__DIR__ . '/../../../config.php');
use tool_mobile\api;
header('Content-Type: application/json; charset: utf-8');
@ -40,7 +39,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' => \core\context\system::instance(),
]);
$manifest->prefer_related_applications = true;
$manifest->icons = [(object)
[