Updated formatting in getremoteaddr, and made add_to_log use it
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user