From e51aa22043b5e48254dc4d10c90c9628b79687c2 Mon Sep 17 00:00:00 2001 From: Peter Fricke <peter.fricke@hs-hannover.de> Date: Fri, 23 Aug 2019 09:06:16 +0200 Subject: [PATCH] updated version and fixed utf8 encoding --- hshcourselist.php | 15 +++++++++++++-- version.php | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/hshcourselist.php b/hshcourselist.php index e5e9e76..4c0a0c6 100644 --- a/hshcourselist.php +++ b/hshcourselist.php @@ -45,5 +45,16 @@ if (!empty($course)) { $courses->close(); } } -header('Content-Type: application/json'); -echo json_encode($output); +header('Content-Type: text/plain'); +echo json_encode(utf8ize($output)); + +function utf8ize($d) { + if (is_array($d)) { + foreach ($d as $k => $v) { + $d[$k] = utf8ize($v); + } + } else if (is_string ($d)) { + return utf8_encode($d); + } + return $d; +} \ No newline at end of file diff --git a/version.php b/version.php index 2450529..aa23f26 100644 --- a/version.php +++ b/version.php @@ -25,5 +25,5 @@ $plugin->component = 'block_hshcourselist'; -$plugin->version = 2019041001; // YYYYMMDDHH. +$plugin->version = 2019082301; // YYYYMMDDHH. $plugin->requires = 2016112900; // YYYYMMDDHH. \ No newline at end of file -- GitLab