]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Older versions of PHP couldn't do array indexes on function returns.
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 8 Feb 2015 10:53:47 +0000 (11:53 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 8 Feb 2015 10:53:47 +0000 (11:53 +0100)
plugins/AntiBrute/AntiBrutePlugin.php

index 342c323016457a397a0e6f0fdef4447f25dfc9c1..365937fedf9bf4d1a6c27bbfbce31e8d1d946415 100755 (executable)
@@ -23,7 +23,8 @@ class AntiBrutePlugin extends Plugin {
         }
 
         // This probably needs some work. For example with IPv6 you can easily generate new IPs...
-        $this->client_ip = common_client_ip()[0] ?: common_client_ip()[1];   // [0] is proxy, [1] should be the real IP
+        $client_ip = common_client_ip();
+        $this->client_ip = $client_ip[0] ?: $client_ip[1];   // [0] is proxy, [1] should be the real IP
         $this->failed_attempts = (int)$this->unauthed_user->getPref(self::FAILED_LOGIN_IP_SECTION, $this->client_ip);
         switch (true) {
         case $this->failed_attempts >= 5: