addslashes to string used for javascript link

This commit is contained in:
moodler 2003-04-02 07:24:42 +00:00
parent 8a205861e0
commit ef49e5c301

View File

@ -245,7 +245,7 @@ function link_to_popup_window ($url, $name="popup", $linkname="click here", $hei
echo "\n<SCRIPT language=\"Javascript\">";
echo "\n<!--";
echo "\ndocument.write('<A TITLE=\"$title\" HREF=javascript:openpopup(\"$url\",\"$name\",\"$height\",\"$width\") >$linkname</A>');";
echo "\ndocument.write('<A TITLE=\"$title\" HREF=javascript:openpopup(\"$url\",\"$name\",\"$height\",\"$width\") >".addslashes($linkname)."</A>');";
echo "\n//-->";
echo "\n</SCRIPT>";
echo "\n<NOSCRIPT>\n<A TARGET=\"$name\" TITLE=\"$title\" HREF=\"$CFG->wwwroot/$url\">$linkname</A>\n</NOSCRIPT>\n";