Changeset 3057573
- Timestamp:
- 03/24/2024 08:28:35 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ip-guard/trunk/ip-guard.php
r3053313 r3057573 3 3 Plugin Name: IPGuard 4 4 Description: A robust security plugin that empowers administrators to safeguard user accounts by implementing IP address-based lockdowns. 5 Version: 1.23. 15 Version: 1.23.2 6 6 Author: <a href="https://wa.link/kemj38">Dynasty</a> 7 7 Contributors: Dynahsty … … 11 11 Tested up to: 6.4.3 12 12 Requires PHP: 7.4 13 Stable tag: 1.23. 113 Stable tag: 1.23.2 14 14 License: GPLv2 or later 15 15 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 if ($client_ip && filter_var($client_ip, FILTER_VALIDATE_IP)) { 35 if (!in_array($client_ip, $stored_ips)) { 35 $first_octet = explode('.', $client_ip)[0]; 36 $similar_ip_exists = false; 37 foreach ($stored_ips as $stored_ip) { 38 if (strpos($stored_ip, $first_octet . '.') === 0) { 39 $similar_ip_exists = true; 40 break; 41 } 42 } 43 44 if (!$similar_ip_exists) { 36 45 $stored_ips[] = $client_ip; 37 46 update_user_meta($user->ID, '_stored_ips', $stored_ips); … … 54 63 return $user; 55 64 } 65 56 66 57 67 function ip_addresses_similar($ip_addresses) {
Note: See TracChangeset
for help on using the changeset viewer.