| @@ 102-108 (lines=7) @@ | ||
| 99 | * @param string $ip |
|
| 100 | * @return boolean |
|
| 101 | */ |
|
| 102 | function ValidateIp($ip) |
|
| 103 | { |
|
| 104 | if (!strcmp(long2ip(sprintf("%u", ip2long($ip))), $ip)) |
|
| 105 | return true; |
|
| 106 | else |
|
| 107 | return false; |
|
| 108 | } // end of function ValidateIp |
|
| 109 | ||
| 110 | ||
| 111 | /** |
|
| @@ 25-33 (lines=9) @@ | ||
| 22 | /** |
|
| 23 | * {@inheritdoc} |
|
| 24 | */ |
|
| 25 | protected function doValidate($value) |
|
| 26 | { |
|
| 27 | if (strcmp(long2ip(sprintf("%u", ip2long($value))), $value)) { |
|
| 28 | $this->setMessage('default'); |
|
| 29 | return false; |
|
| 30 | } else { |
|
| 31 | return true; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||