Skip to content

Commit

Permalink
add ip mask
Browse files Browse the repository at this point in the history
  • Loading branch information
BadApple9 committed Nov 17, 2020
1 parent 2436e85 commit 0c70ecb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ speedtest-x 使用文件数据库来保存来自不同用户的测速结果,

## 恰饭

Jetbrains全家桶教育许可,正规国内大学渠道,9.9元,购买地址:[https://xiaozhu.win](https://xiaozhu.win)
Jetbrains 全家桶教育许可,正规国内大学渠道,9.9 元,购买地址:[https://xiaozhu.win](https://xiaozhu.win)

## 环境要求
- PHP 5.6+
Expand Down
5 changes: 4 additions & 1 deletion backend/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
'timeout' => 120
]);

$ip = filter_var($_POST['ip'], FILTER_SANITIZE_STRING);
$ipMask = preg_replace('/((?:\d{1,3}\.){3})\d{1,3}/','$1*', $ip);

$reportData = [
"ip" => filter_var($_POST['ip'], FILTER_SANITIZE_STRING),
"ip" => $ipMask,
"isp" => filter_var($_POST['isp'], FILTER_SANITIZE_STRING),
"addr" => filter_var($_POST['addr'], FILTER_SANITIZE_STRING),
"dspeed" => filter_var($_POST['dspeed'], FILTER_SANITIZE_STRING),
Expand Down

0 comments on commit 0c70ecb

Please sign in to comment.