From 9f44d972c749f773a2f509b4e1ab861bebd41171 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 22 Jan 2003 01:55:54 +0000 Subject: [PATCH] Add slashes to data pulled out of external source, just in case O'Brien logs in :-) --- lib/moodlelib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 143d22343d..441daf1aea 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -268,7 +268,9 @@ function require_login($courseid=0) { // First check that the user is logged in to the site. if (! (isset($USER->loggedin) and $USER->confirmed and ($USER->site == $CFG->wwwroot)) ) { // They're not $SESSION->wantsurl = $FULLME; - $SESSION->fromurl = $_SERVER["HTTP_REFERER"]; + if (!empty($_SERVER["HTTP_REFERER"])) { + $SESSION->fromurl = $_SERVER["HTTP_REFERER"]; + } save_session("SESSION"); $USER = NULL; save_session("USER"); @@ -485,7 +487,7 @@ function create_user_record($username, $password) { if (function_exists(auth_get_userinfo)) { if ($newinfo = auth_get_userinfo($username)) { foreach ($newinfo as $key => $value){ - $newuser->$key = $value; + $newuser->$key = addslashes(stripslashes($value)); // Just in case } } } -- 2.39.5