Further tidyup to the cleanremoteaddr function I added - some thing were getting through

This commit is contained in:
mjollnir_
2005-09-07 04:45:52 +00:00
parent e1fede4e63
commit 72ed1089dd
+4 -1
View File
@@ -6101,7 +6101,10 @@ function unzip_show_status ($list,$removepath) {
* 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;
}
/**