From 1cd4d9dffe329957bdb3082ab6e93d7ed7ed2c69 Mon Sep 17 00:00:00 2001 From: gbateson Date: Mon, 26 Nov 2007 00:14:54 +0000 Subject: [PATCH] fix MDL-12318: from Moodle 1.8 onward, the HotPot module has its own mediaplugin filter, because teh standard Moodle "filter/mediaplugin" can no longer insert media players into Javascript. --- mod/hotpot/lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index 87e5f4e8180..ca6ae6e4860 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -1730,7 +1730,8 @@ class hotpot_xml_quiz extends hotpot_xml_tree { // make sure the Moodle media plugin is available global $CFG; - include_once "$CFG->dirroot/filter/mediaplugin/filter.php"; + //include_once "$CFG->dirroot/filter/mediaplugin/filter.php"; + include_once "$CFG->dirroot/mod/hotpot/mediaplayers/moodle/filter.php"; // exclude swf files from the filter //$CFG->filter_mediaplugin_ignore_swf = true; @@ -1757,7 +1758,7 @@ class hotpot_xml_quiz extends hotpot_xml_tree { $link_url = "/{$tagopen}a{$space}href=$quote($filepath)$quote.*?$tagclose.*?$tagreopen\/A$tagclose/is"; // extract tags - preg_match_all("/{$tagopen}object\s.*?{$tagclose}(.*?){$tagreopen}\/object{$tagclose}/is", $this->html, $objects); + preg_match_all("/{$tagopen}object\s.*?{$tagclose}(.*?)(?:{$tagreopen}\/object{$tagclose})+/is", $this->html, $objects); $i_max = count($objects[0]); for ($i=0; $i<$i_max; $i++) { @@ -1776,7 +1777,7 @@ class hotpot_xml_quiz extends hotpot_xml_tree { $url = preg_replace('/^[^?]*\?([^=]+=[^&]*&)*[^=]+=([^&]*)$/', '$2', $url, 1); $link = ''.$txt.''; - $new_object = mediaplugin_filter($this->filedir, $link); + $new_object = hotpot_mediaplayer_moodle($this, $link); $new_object = str_replace($link, '', $new_object); $new_object = str_replace('&', '&', $new_object);