Skip to content

Commit

Permalink
ange relative URLs to absolute URLs in window.open(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbateson committed Jun 26, 2007
1 parent 1239139 commit ca8c7db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mod/hotpot/lib.php
Expand Up @@ -1529,7 +1529,12 @@ function hotpot_xml_quiz(&$obj, $read_file=true, $parse_xml=true, $convert_urls=
$replace = "hotpot_convert_navbutton_url('".$this->get_baseurl()."','".$this->reference."','\\1','".$this->course."')";
$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);

} else {
if ($this->parse_xml) {

$this->filetype = 'xml';
Expand Down

0 comments on commit ca8c7db

Please sign in to comment.