]> git.mjollnir.org Git - moodle.git/commitdiff
Merged notice fix from stable
authormoodler <moodler>
Mon, 5 Mar 2007 05:47:27 +0000 (05:47 +0000)
committermoodler <moodler>
Mon, 5 Mar 2007 05:47:27 +0000 (05:47 +0000)
lib/weblib.php
mod/forum/post.php

index 73e1a22d3f8861e3c0fbfad2506a9da2b010580a..b55816955d0f2d10a2a76fb7edc8ab405fbd7a4f 100644 (file)
@@ -180,12 +180,16 @@ function addslashes_js($var) {
 }
 
 /**
- * Returns the URL of the HTTP_REFERER, less the querystring portion
+ * Returns the URL of the HTTP_REFERER, less the querystring portion if required
  * @return string
  */
-function get_referer() {
+function get_referer($stripquery=true) {
     if (isset($_SERVER['HTTP_REFERER'])) {
-        return strip_querystring($_SERVER['HTTP_REFERER']);
+        if ($stripquery) {
+            return strip_querystring($_SERVER['HTTP_REFERER']);
+        } else {
+            return $_SERVER['HTTP_REFERER'];
+        }
     } else {
         return '';
     }
index 19951d7f6e698819fbec0ca5f9046815e551ad60..1d2113aee433d54ee5d6cf5b455b5bef545e637d 100644 (file)
@@ -66,7 +66,7 @@
                   '', '', true, "", navmenu($course, $cm));
         }
         notice_yesno(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'),
-                     $wwwroot, $_SERVER['HTTP_REFERER']);
+                     $wwwroot, get_referer(false));
         print_footer($course);
         exit;
     }