[FIX] Fix 'Trying to access array offset on value of type null' in AntiBrutePlugin and SimpleCaptchaPlugin when using scripts

Esse commit está contido em:
Hugo Sales
2020-05-24 16:54:22 +00:00
commit 7e83ddf80e
2 arquivos alterados com 6 adições e 2 exclusões
+3 -1
Ver Arquivo
@@ -14,7 +14,9 @@ class AntiBrutePlugin extends Plugin {
{
// This probably needs some work. For example with IPv6 you can easily generate new IPs...
$client_ip = common_client_ip();
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
if (!empty($client_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)
+3 -1
Ver Arquivo
@@ -31,7 +31,9 @@ class SimpleCaptchaPlugin extends Plugin
{
// This probably needs some work. For example with IPv6 you can easily generate new IPs...
$client_ip = common_client_ip();
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
if (!empty($client_ip)) {
$this->client_ip = $client_ip[0] ?: $client_ip[1]; // [0] is proxy, [1] should be the real IP
}
}
public function onEndRegistrationFormData(Action $action)