Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merged from MOODLE_15_STABLE: Further tidyup to the cleanremoteaddr f…

…unction I added - some thing were getting through
  • Loading branch information...
commit 3bff4935eb591c135c555320a96a24bf4f692c84 1 parent 1807d0a
mjollnir_ authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/moodlelib.php
View
5 lib/moodlelib.php
@@ -6335,7 +6335,10 @@ function getremoteaddr() {
* Cleans a remote address ready to put into the log table
*/
function cleanremoteaddr($addr) {
- return preg_replace('/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(.*)/','$1',$addr);
+ $addr = preg_replace('/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(.*)/','$1',$addr);
+ // just to make SURE, we strip off anything past a ,
+ $addr = preg_replace('/(.*)\,(.*)/','$1',$addr);
+ return $addr;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.