MDL-59490 mod_lti: Prevent text wrapping
authorStephen Vickers <github@spvickers.freeserve.co.uk>
Mon, 10 Jul 2017 16:01:54 +0000 (17:01 +0100)
committerStephen Vickers <github@spvickers.freeserve.co.uk>
Mon, 10 Jul 2017 16:01:54 +0000 (17:01 +0100)
Update html_to_text method calls with a width of zero.

mod/lti/locallib.php

index c526a97..2247c36 100644 (file)
@@ -386,11 +386,11 @@ function lti_build_request($instance, $typeconfig, $course, $typeid = null, $isl
         'lis_person_sourcedid' => $USER->idnumber,
         'roles' => $role,
         'context_id' => $course->id,
-        'context_label' => trim(html_to_text($course->shortname)),
-        'context_title' => trim(html_to_text($course->fullname)),
+        'context_label' => trim(html_to_text($course->shortname, 0)),
+        'context_title' => trim(html_to_text($course->fullname, 0)),
     );
     if (!empty($instance->name)) {
-        $requestparams['resource_link_title'] = trim(html_to_text($instance->name));
+        $requestparams['resource_link_title'] = trim(html_to_text($instance->name, 0));
     }
     if (!empty($instance->cmid)) {
         $intro = format_module_intro('lti', $instance, $instance->cmid);
@@ -531,11 +531,11 @@ function lti_build_standard_request($instance, $orgid, $islti2, $messagetype = '
         $requestparams["tool_consumer_instance_guid"] = $orgid;
     }
     if (!empty($CFG->mod_lti_institution_name)) {
-        $requestparams['tool_consumer_instance_name'] = trim(html_to_text($CFG->mod_lti_institution_name));
+        $requestparams['tool_consumer_instance_name'] = trim(html_to_text($CFG->mod_lti_institution_name, 0));
     } else {
         $requestparams['tool_consumer_instance_name'] = get_site()->shortname;
     }
-    $requestparams['tool_consumer_instance_description'] = trim(html_to_text(get_site()->fullname));
+    $requestparams['tool_consumer_instance_description'] = trim(html_to_text(get_site()->fullname, 0));
 
     return $requestparams;
 }