$output = '';
- if (!$link) {
-
- $link = $_SERVER['HTTP_REFERER'];
+ if ($link == '') {
+ if (!empty($_SERVER['HTTP_REFERER'])) {
+ $link = $_SERVER['HTTP_REFERER'];
+ $link = str_replace('&', '&', $link); // make it valid XHTML
+ } else {
+ $link = $CFG->wwwroot .'/';
+ }
}
$output .= '<div class="continuebutton">';
}
}
-/*
+/**
* Starts a box using divs
* Replaces print_simple_box_start (see deprecatedlib.php)
*
}
-/*
+/**
* Simple function to end a box (see above)
* Replaces print_simple_box_end (see deprecatedlib.php)
*
$output = '';
$output .= '<div class="singlebutton">';
// taking target out, will need to add later target="'.$target.'"
- $output .= '<form action="'. $link .'" method="'. $method .'">';
+ $output .= '<form action="'. s($link) .'" method="'. $method .'">';
$output .= '<fieldset class="invisiblefieldset">';
if ($options) {
foreach ($options as $name => $value) {
- $output .= '<input type="hidden" name="'. $name .'" value="'. $value .'" />';
+ $output .= '<input type="hidden" name="'. $name .'" value="'. s($value) .'" />';
}
}
- $output .= '<input type="submit" value="'. $label .'" /></fieldset></form></div>';
+ $output .= '<input type="submit" value="'. s($label) .'" /></fieldset></form></div>';
if ($return) {
return $output;
global $CFG, $SITE;
$message = clean_text($message);
- $link = clean_text($link);
-
- if (!$link) {
- if (!empty($_SERVER['HTTP_REFERER'])) {
- $link = $_SERVER['HTTP_REFERER'];
- } else {
- $link = $CFG->wwwroot .'/';
- }
- }
print_box($message, 'generalbox', 'notice');
print_continue($link);