From: stronk7 Date: Sun, 7 Dec 2008 17:34:37 +0000 (+0000) Subject: MDL-17518 resource names filter: Improve handling when name contains htmlentities... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e6b3d18342ff97a4cf46e0a9be273159996a7478;p=moodle.git MDL-17518 resource names filter: Improve handling when name contains htmlentities() chars. Merged from 19_STABLE --- diff --git a/mod/resource/filter.php b/mod/resource/filter.php index e722b259dd..54826a741e 100644 --- a/mod/resource/filter.php +++ b/mod/resource/filter.php @@ -53,14 +53,22 @@ $resourcelist = array(); foreach ($resources as $resource) { - $currentname = trim($resource->name); - $strippedname = strip_tags($currentname); + $currentname = trim($resource->name); + $entitisedname = s($currentname); + $strippedname = strip_tags($currentname); /// Avoid empty or unlinkable resource names if (!empty($strippedname)) { $resourcelist[] = new filterobject($currentname, 'frametarget.'>', + $CFG->wwwroot.'/mod/resource/view.php?r='.$resource->id.'" '.$CFG->frametarget.'>', '', false, true); + if ($currentname != $entitisedname) { /// If name has some entity (& " < >) add that filter too. MDL-17518 + $resourcelist[] = new filterobject($entitisedname, + 'frametarget.'>', + '', false, true); + + } } }