From 60011d9a8a220daccc748c23c5344838d2a26ae0 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Mon, 2 May 2016 16:52:21 +0800 Subject: [PATCH] MDL-53982 competency: Javascript error due to string injection --- .../tool/lp/classes/output/competency_plan_navigation.php | 1 - .../classes/output/user_competency_course_navigation.php | 2 -- .../tool/lp/templates/competency_plan_navigation.mustache | 4 ++-- .../templates/user_competency_course_navigation.mustache | 8 ++++---- .../competency/classes/output/user_course_navigation.php | 1 - .../competency/templates/user_course_navigation.mustache | 4 ++-- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/admin/tool/lp/classes/output/competency_plan_navigation.php b/admin/tool/lp/classes/output/competency_plan_navigation.php index 4ffde895199..58ab38bfc9f 100644 --- a/admin/tool/lp/classes/output/competency_plan_navigation.php +++ b/admin/tool/lp/classes/output/competency_plan_navigation.php @@ -79,7 +79,6 @@ class competency_plan_navigation implements renderable, templatable { $data->competencyid = $this->competencyid; $data->planid = $this->planid; $data->baseurl = $this->baseurl; - $data->jumptocompetency = get_string('jumptocompetency', 'tool_lp'); $plancompetencies = \core_competency\api::list_plan_competencies($data->planid); $data->competencies = array(); diff --git a/admin/tool/lp/classes/output/user_competency_course_navigation.php b/admin/tool/lp/classes/output/user_competency_course_navigation.php index 411a296dabb..3d716b5a55a 100644 --- a/admin/tool/lp/classes/output/user_competency_course_navigation.php +++ b/admin/tool/lp/classes/output/user_competency_course_navigation.php @@ -84,8 +84,6 @@ class user_competency_course_navigation implements renderable, templatable { $data->courseid = $this->courseid; $data->baseurl = $this->baseurl; $data->groupselector = ''; - $data->jumptocompetency = get_string('jumptocompetency', 'tool_lp'); - $data->jumptouser = get_string('jumptouser', 'tool_lp'); if (has_any_capability(array('moodle/competency:usercompetencyview', 'moodle/competency:coursecompetencymanage'), $context)) { diff --git a/admin/tool/lp/templates/competency_plan_navigation.mustache b/admin/tool/lp/templates/competency_plan_navigation.mustache index bf70ee9a7b5..490d1b8e0db 100644 --- a/admin/tool/lp/templates/competency_plan_navigation.mustache +++ b/admin/tool/lp/templates/competency_plan_navigation.mustache @@ -1,7 +1,7 @@
{{#hascompetencies}} - + {{#users}} @@ -14,7 +14,7 @@
{{#hascompetencies}} - + {{#users}} @@ -17,7 +17,7 @@ require(['core/form-autocomplete', 'report_competency/user_course_navigation'], function(autocomplete, nav) { (new nav('#user-nav-{{uniqid}}', '{{baseurl}}', {{userid}}, {{courseid}})); {{#hasusers}} - autocomplete.enhance('#user-nav-{{uniqid}}', false, false, '{{jumptouser}}'); + autocomplete.enhance('#user-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptouser, tool_lp{{/ str }}{{/ quote }}); {{/hasusers}} }); {{/js}}