Permalink
Browse files

Further tidyup to the cleanremoteaddr function I added - some thing w…

…ere getting through
  • Loading branch information...
1 parent e1fede4 commit 72ed1089dd108f548e6b90c8422c985cd3b0f470 mjollnir_ committed Sep 7, 2005
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/moodlelib.php
View
5 lib/moodlelib.php
@@ -6101,7 +6101,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;
}
/**

0 comments on commit 72ed108

Please sign in to comment.