This repository was archived by the owner on Jun 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+ on : [push, pull_request]
3
+
4
+ jobs :
5
+ run :
6
+ runs-on : ${{ matrix.os }}
7
+
8
+ strategy :
9
+ matrix :
10
+ os : [ubuntu-latest]
11
+ php : ['7.3', '7.4', '8.0']
12
+
13
+ name : PHP ${{ matrix.php }} Test on ${{ matrix.os }}
14
+
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v2
18
+
19
+ - name : Setup PHP
20
+ uses : shivammathur/setup-php@v2
21
+ with :
22
+ php-version : ${{matrix.php}}
23
+
24
+ - name : Install dependencies
25
+ uses : php-actions/composer@v5
26
+ with :
27
+ args : --prefer-source --no-interaction
28
+
29
+ - name : Run composer test script
30
+ uses : php-actions/composer@v5
31
+ with :
32
+ command : test
Original file line number Diff line number Diff line change 51
51
/**
52
52
*
53
53
* IP addresses for which validation will be skipped
54
+ * IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
54
55
*
55
56
*/
56
- 'skip_ip ' => [] ,
57
+ 'skip_ip ' => env ( ' RECAPTCHA_SKIP_IP ' , []) ,
57
58
58
59
/**
59
60
*
Original file line number Diff line number Diff line change 12
12
namespace Biscolab \ReCaptcha ;
13
13
14
14
use Illuminate \Support \Arr ;
15
+ use Symfony \Component \HttpFoundation \IpUtils ;
15
16
16
17
/**
17
18
* Class ReCaptchaBuilder
@@ -247,8 +248,7 @@ public function getIpWhitelist()
247
248
*/
248
249
public function skipByIp (): bool
249
250
{
250
-
251
- return (in_array (request ()->ip (), $ this ->getIpWhitelist ()));
251
+ return IpUtils::checkIp (request ()->ip (), $ this ->getIpWhitelist ());
252
252
}
253
253
254
254
/**
You can’t perform that action at this time.
0 commit comments