Updated formatting in getremoteaddr, and made add_to_log use it

This commit is contained in:
moodler
2005-04-01 07:40:07 +00:00
parent 5b2ae5848c
commit fcaff7ffcd
2 changed files with 13 additions and 6 deletions
+3 -1
View File
@@ -2627,7 +2627,7 @@ function instance_is_visible($moduletype, $module) {
*/
function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user=0) {
global $db, $CFG, $USER, $REMOTE_ADDR;
global $db, $CFG, $USER;
if ($cm === '') { // postgres won't translate empty string to its default
$cm = 0;
@@ -2642,6 +2642,8 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
$userid = empty($USER->id) ? '0' : $USER->id;
}
$REMOTE_ADDR = getremoteaddr();
$timenow = time();
$info = addslashes($info);
$url = html_entity_decode($url); // for php < 4.3.0 this is defined in moodlelib.php