]> git.mjollnir.org Git - moodle.git/commitdiff
Add a backdoor for match_referer ... if the referer is "nomatch" then
authormoodler <moodler>
Mon, 12 May 2003 09:22:00 +0000 (09:22 +0000)
committermoodler <moodler>
Mon, 12 May 2003 09:22:00 +0000 (09:22 +0000)
it always returns true.

lib/weblib.php

index 7f46217f780f04772064fad40d9ce81174192c88..203654d3ee01f2d3f46e7de0204be2110edfd28d 100644 (file)
@@ -129,19 +129,23 @@ function qualified_me() {
 }
 
 
-function match_referer($good_referer = "") {
-/// returns true if the referer is the same as the good_referer.  If
-/// good_referer is not specified, use qualified_me as the good_referer 
+function match_referer($goodreferer = "") {
+/// returns true if the referer is the same as the goodreferer.  If
+/// goodreferer is not specified, use qualified_me as the goodreferer 
     global $CFG;
 
     if (!empty($CFG->buggy_referer)) {
         return true;
     }
 
-    if (empty($good_referer)) { 
-        $good_referer = qualified_me(); 
+    if ($goodreferer == "nomatch") {
+        return true;
+    }
+
+    if (empty($goodreferer)) { 
+        $goodreferer = qualified_me(); 
     }
-    return $good_referer == get_referer();
+    return $goodreferer == get_referer();
 }
 
 function data_submitted($url="") {