*/ class LSformRule_ssh_pub_key extends LSformRule { /** * Validate SSH public key value * * @param string $values The value to validate * @param array $options Validation options * @param object $formElement The related formElement object * * @return boolean true if the value is valide, false if not */ public static function validate($value, $options, &$formElement) { if (preg_match('/^(ssh-[a-z0-9]+) +([^ ]+) +(.*)$/', $value, $m)) { $data=@base64_decode($m[2]); if (is_string($data)) return true; } return false; } }