Skip to content

Commit

Permalink
Check if we really get an IP from gethostbyname.
Browse files Browse the repository at this point in the history
  • Loading branch information
matejvelikonja committed Dec 25, 2012
1 parent 2532480 commit ad3ed56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Library/IRC/Command/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ protected function getUserIp() {

$ip = gethostbyname($hostname);

if ($ip !== $hostname) {
// did we really get an IP
if (preg_match( '/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/', $ip ) === 1) {
return $ip;
}
}
Expand Down

0 comments on commit ad3ed56

Please sign in to comment.