[FIX] Fix 'Trying to access array offset on value of type null' in AntiBrutePlugin and SimpleCaptchaPlugin when using scripts
This commit is contained in:
parent
34e1a6ee08
commit
facf3204d3
|
@ -14,8 +14,10 @@ class AntiBrutePlugin extends Plugin {
|
||||||
{
|
{
|
||||||
// This probably needs some work. For example with IPv6 you can easily generate new IPs...
|
// This probably needs some work. For example with IPv6 you can easily generate new IPs...
|
||||||
$client_ip = common_client_ip();
|
$client_ip = common_client_ip();
|
||||||
|
if (!empty($client_ip)) {
|
||||||
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
|
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function onStartCheckPassword($nickname, $password, &$authenticatedUser)
|
public function onStartCheckPassword($nickname, $password, &$authenticatedUser)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,10 @@ class SimpleCaptchaPlugin extends Plugin
|
||||||
{
|
{
|
||||||
// This probably needs some work. For example with IPv6 you can easily generate new IPs...
|
// This probably needs some work. For example with IPv6 you can easily generate new IPs...
|
||||||
$client_ip = common_client_ip();
|
$client_ip = common_client_ip();
|
||||||
|
if (!empty($client_ip)) {
|
||||||
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
|
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function onEndRegistrationFormData(Action $action)
|
public function onEndRegistrationFormData(Action $action)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user