Permalink
Browse files

change relative URLs to absolute URLs in window.open(...)

  • Loading branch information...
1 parent 81bf069 commit 9036033b8a6ce042f374879e0fa5f40cd2adddb3 gbateson committed Jun 26, 2007
Showing with 5 additions and 0 deletions.
  1. +5 −0 mod/hotpot/lib.php
View
@@ -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."')";
$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 {
if ($this->parse_xml) {

0 comments on commit 9036033

Please sign in to comment.