/** * Set the author IP. * @param {string} $ip The author IP. * @throws {Exception} If $ip is not a valid IP. */ public function setAuthorIp($ip) { if (!ae_Validate::ip($ip)) { $msg = sprintf('[%s] Not a valid IP: %s', get_class(), htmlspecialchars($ip)); throw new Exception($msg); } $this->authorIp = $ip; }
public function testValidateIp() { $this->assertTrue(ae_Validate::ip('78.43.208.225')); }