瀏覽代碼

add protection

andre 4 年之前
父節點
當前提交
54c0ec79b9
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      admin.php

+ 2 - 2
admin.php

@@ -35,13 +35,13 @@ if(isset($_GET['role'])) {
 if(isset($_GET['description'])) {
 if(isset($_GET['description'])) {
     $description = substr(trim($_GET['description']),0,40);
     $description = substr(trim($_GET['description']),0,40);
 }
 }
-$clientIP = substr(trim($_SERVER['REMOTE_ADDR']),0,15);
+$clientIP = ip2long(substr(trim($_SERVER['REMOTE_ADDR']),0,15));
 $stats = true;
 $stats = true;
 
 
 $tok = new token;
 $tok = new token;
 $act = new action;
 $act = new action;
 
 
-if($act->isBlocked(ip2long($clientIP))) {
+if($act->isBlocked($clientIP)) {
     http_response_code(403);
     http_response_code(403);
     exit;
     exit;
 }
 }