in XML source files of HP quizzes, convert relative URLs to absolute URLs in links using window.open(...)
This commit is contained in:
@@ -1535,6 +1535,13 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
|
||||
$this->source = preg_replace($search, $replace, $this->source);
|
||||
|
||||
} else {
|
||||
|
||||
// relative URLs in <a ... onclick="window.open('...')...">...</a>
|
||||
$search = '|'.'(?<='.'onclick="'."window.open\\('".')'."(.*?)".'(?='."'\\);return false;".'")'.'|ise';
|
||||
$replace = "hotpot_convert_url('".$this->get_baseurl()."','".$this->reference."','\\1')";
|
||||
$this->source = preg_replace($search, $replace, $this->source);
|
||||
|
||||
|
||||
if ($this->parse_xml) {
|
||||
|
||||
$this->filetype = 'xml';
|
||||
|
||||
Reference in New Issue
Block a user