Skip to content

Commit

Permalink
MDL-47690 web services: Fixed invalid return parameter type in mod_url
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed Oct 24, 2014
1 parent 8950e7f commit e13c152
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion course/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ public function test_get_course_contents() {
$label = $this->getDataGenerator()->create_module('label', array('course' => $course->id,
'intro' => $labeldescription));
$labelcm = get_coursemodule_from_instance('label', $label->id);
$url = $this->getDataGenerator()->create_module('url', array('course' => $course->id));
$url = $this->getDataGenerator()->create_module('url', array('course' => $course->id,
'name' => 'URL: % & $ ../'));
$urlcm = get_coursemodule_from_instance('url', $url->id);

// Set the required capabilities by the external function.
$context = context_course::instance($course->id);
Expand Down
2 changes: 1 addition & 1 deletion mod/url/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function url_export_contents($cm, $baseurl) {

$url = array();
$url['type'] = 'url';
$url['filename'] = $urlrecord->name;
$url['filename'] = clean_param(format_string($urlrecord->name), PARAM_FILE);
$url['filepath'] = null;
$url['filesize'] = 0;
$url['fileurl'] = $fullurl;
Expand Down

0 comments on commit e13c152

Please sign in to comment.