Permalink
Browse files

Avoid empty or unlinkable activity names.

Merged from MOODLE_15_STABLE
  • Loading branch information...
1 parent 32a50e2 commit bcbebdc53bbfd2568c7003d647f6dc142f323210 stronk7 committed Sep 5, 2005
Showing with 8 additions and 4 deletions.
  1. +8 −4 mod/resource/filter.php
@@ -34,10 +34,14 @@ function resource_filter($courseid, $text) {
foreach ($resources as $resource) {
$currentname = trim($resource->name);
- $resourcelist[] = new filterobject($currentname,
- '<a class="resource autolink" title="'.strip_tags($currentname).'" href="'.
- $CFG->wwwroot.'/mod/resource/view.php?r='.$resource->id.'">',
- '</a>', false, true);
+ $strippedname = strip_tags($currentname);
+ /// Avoid empty or unlinkable resource names
+ if (!empty($strippedname)) {
+ $resourcelist[] = new filterobject($currentname,
+ '<a class="resource autolink" title="'.$strippedname.'" href="'.
+ $CFG->wwwroot.'/mod/resource/view.php?r='.$resource->id.'">',
+ '</a>', false, true);
+ }
}
}

0 comments on commit bcbebdc

Please sign in to comment.