1: <?php
2:
3: 4: 5:
6: class Quform_Validator_Honeypot extends Quform_Validator_Abstract
7: {
8: 9: 10: 11: 12: 13:
14: public function isValid($value)
15: {
16: return is_string($value) && $value === '';
17: }
18:
19: 20: 21: 22: 23: 24:
25: public static function getMessageTemplates($key = null)
26: {
27: $messageTemplates = array();
28:
29: if (is_string($key)) {
30: return array_key_exists($key, $messageTemplates) ? $messageTemplates[$key] : null;
31: }
32:
33: return $messageTemplates;
34: }
35:
36: 37: 38: 39: 40: 41:
42: public static function getDefaultConfig($key = null)
43: {
44: $config = apply_filters('quform_default_config_validator_honeypot', array());
45:
46: $config['type'] = 'honeypot';
47:
48: if (Quform::isNonEmptyString($key)) {
49: return Quform::get($config, $key);
50: }
51:
52: return $config;
53: }
54: }
55: