Created
September 4, 2017 20:19
-
-
Save KalleZ/6d229b58bf3b97eba5b28469409845a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* ... */ | |
| protected static getRemoteIP() : string | |
| { | |
| if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) | |
| { | |
| return($_SERVER['HTTP_X_FORWARDED_FOR']); | |
| } | |
| elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR']) | |
| { | |
| return($_SERVER['REMOTE_ADDR']); | |
| } | |
| throw new reCAPTCHAException('Unable to fetch remote IP.'); | |
| } | |
| /* ... */ | |
| /* ... */ | |
| $ip = $this->ip ? $this->ip : self::getRemoteIP(); | |
| /* ... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment