File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,19 @@ public function user()
5050 private static function checkIP ()
5151 {
5252 if (getenv ('HTTP_CLIENT_IP ' )) {
53- $ ip = getenv ('HTTP_CLIENT_IP ' );
53+ $ ip = filter_var ( getenv ('HTTP_CLIENT_IP ' ), FILTER_VALIDATE_IP );
5454 } elseif (getenv ('HTTP_X_FORWARDED_FOR ' )) {
55- $ ip = getenv ('HTTP_X_FORWARDED_FOR ' );
55+ $ ip = filter_var ( getenv ('HTTP_X_FORWARDED_FOR ' ), FILTER_VALIDATE_IP );
5656 } elseif (getenv ('HTTP_X_FORWARDED ' )) {
57- $ ip = getenv ('HTTP_X_FORWARDED ' );
57+ $ ip = filter_var ( getenv ('HTTP_X_FORWARDED ' ), FILTER_VALIDATE_IP );
5858 } elseif (getenv ('HTTP_FORWARDED_FOR ' )) {
59- $ ip = getenv ('HTTP_FORWARDED_FOR ' );
59+ $ ip = filter_var ( getenv ('HTTP_FORWARDED_FOR ' ), FILTER_VALIDATE_IP );
6060 } elseif (getenv ('HTTP_FORWARDED ' )) {
61- $ ip = getenv ('HTTP_FORWARDED ' );
61+ $ ip = filter_var ( getenv ('HTTP_FORWARDED ' ), FILTER_VALIDATE_IP );
6262 } else {
63- $ ip = sanitize_text_field ($ _SERVER ['REMOTE_ADDR ' ]);
63+ $ ip = filter_var ($ _SERVER ['REMOTE_ADDR ' ], FILTER_VALIDATE_IP );
6464 }
65-
65+
6666 return $ ip ;
6767 }
6868
You can’t perform that action at this time.
0 commit comments