Skip to content

Commit

Permalink
change 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 81bf069 commit 9036033
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mod/hotpot/lib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1529,6 +1529,11 @@ 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."')"; $replace = "hotpot_convert_navbutton_url('".$this->get_baseurl()."','".$this->reference."','\\1','".$this->course."')";
$this->source = preg_replace($search, $replace, $this->source); $this->source = preg_replace($search, $replace, $this->source);


// 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 { } else {
if ($this->parse_xml) { if ($this->parse_xml) {


Expand Down

0 comments on commit 9036033

Please sign in to comment.