@@ -3,25 +3,25 @@ |
||
3 | 3 | |
4 | 4 | class EE_Foreign_Key_Int_Field extends EE_Foreign_Key_Field_Base |
5 | 5 | { |
6 | - function get_wpdb_data_type() |
|
7 | - { |
|
8 | - return '%d'; |
|
9 | - } |
|
6 | + function get_wpdb_data_type() |
|
7 | + { |
|
8 | + return '%d'; |
|
9 | + } |
|
10 | 10 | |
11 | - /** |
|
12 | - * @param int|EE_Base_Class $value_inputted_for_field_on_model_object |
|
13 | - * @return int |
|
14 | - */ |
|
15 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
16 | - { |
|
17 | - if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) { |
|
18 | - $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID(); |
|
19 | - } |
|
20 | - return absint($value_inputted_for_field_on_model_object); |
|
21 | - } |
|
11 | + /** |
|
12 | + * @param int|EE_Base_Class $value_inputted_for_field_on_model_object |
|
13 | + * @return int |
|
14 | + */ |
|
15 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
16 | + { |
|
17 | + if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) { |
|
18 | + $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID(); |
|
19 | + } |
|
20 | + return absint($value_inputted_for_field_on_model_object); |
|
21 | + } |
|
22 | 22 | |
23 | - function prepare_for_set_from_db($value_found_in_db_for_model_object) |
|
24 | - { |
|
25 | - return intval($value_found_in_db_for_model_object); |
|
26 | - } |
|
23 | + function prepare_for_set_from_db($value_found_in_db_for_model_object) |
|
24 | + { |
|
25 | + return intval($value_found_in_db_for_model_object); |
|
26 | + } |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Foreign_Key_Field_Base.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Foreign_Key_Field_Base.php'); |
|
3 | 3 | |
4 | 4 | class EE_Foreign_Key_Int_Field extends EE_Foreign_Key_Field_Base |
5 | 5 | { |
@@ -5,12 +5,12 @@ |
||
5 | 5 | */ |
6 | 6 | class EE_WP_Post_Type_Field extends EE_DB_Only_Text_Field |
7 | 7 | { |
8 | - /** |
|
9 | - * @param string $post_type the exact string to be used for the post type |
|
10 | - * of all these post type model objects/rows |
|
11 | - */ |
|
12 | - function __construct($post_type) |
|
13 | - { |
|
14 | - parent::__construct('post_type', __("Post Type", 'event_espresso'), false, $post_type); |
|
15 | - } |
|
8 | + /** |
|
9 | + * @param string $post_type the exact string to be used for the post type |
|
10 | + * of all these post type model objects/rows |
|
11 | + */ |
|
12 | + function __construct($post_type) |
|
13 | + { |
|
14 | + parent::__construct('post_type', __("Post Type", 'event_espresso'), false, $post_type); |
|
15 | + } |
|
16 | 16 | } |
17 | 17 | \ No newline at end of file |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | class EE_DB_Only_Text_Field extends EE_DB_Only_Field_Base |
5 | 5 | { |
6 | - function get_wpdb_data_type() |
|
7 | - { |
|
8 | - return '%s'; |
|
9 | - } |
|
6 | + function get_wpdb_data_type() |
|
7 | + { |
|
8 | + return '%s'; |
|
9 | + } |
|
10 | 10 | } |
11 | 11 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(EE_MODELS . 'fields/EE_DB_Only_Field_Base.php'); |
|
3 | +require_once(EE_MODELS.'fields/EE_DB_Only_Field_Base.php'); |
|
4 | 4 | |
5 | 5 | class EE_DB_Only_Int_Field extends EE_DB_Only_Field_Base |
6 | 6 | { |
@@ -11,59 +11,59 @@ |
||
11 | 11 | |
12 | 12 | class EE_Serialized_Text_Field extends EE_Text_Field_Base |
13 | 13 | { |
14 | - /** |
|
15 | - * Value SHOULD be an array, and we want to now convert it to a serialized string |
|
16 | - * |
|
17 | - * @param array $value_of_field_on_model_object |
|
18 | - * @return string |
|
19 | - */ |
|
20 | - function prepare_for_use_in_db($value_of_field_on_model_object) |
|
21 | - { |
|
22 | - return maybe_serialize($value_of_field_on_model_object); |
|
23 | - } |
|
14 | + /** |
|
15 | + * Value SHOULD be an array, and we want to now convert it to a serialized string |
|
16 | + * |
|
17 | + * @param array $value_of_field_on_model_object |
|
18 | + * @return string |
|
19 | + */ |
|
20 | + function prepare_for_use_in_db($value_of_field_on_model_object) |
|
21 | + { |
|
22 | + return maybe_serialize($value_of_field_on_model_object); |
|
23 | + } |
|
24 | 24 | |
25 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
26 | - { |
|
27 | - $value_inputted_for_field_on_model_object = EEH_Array::maybe_unserialize($value_inputted_for_field_on_model_object); |
|
28 | - if (is_string($value_inputted_for_field_on_model_object)) { |
|
29 | - return parent::prepare_for_set($value_inputted_for_field_on_model_object); |
|
30 | - } elseif (is_array($value_inputted_for_field_on_model_object)) { |
|
31 | - return array_map(array($this, 'prepare_for_set'), $value_inputted_for_field_on_model_object); |
|
32 | - } else {//so they passed NULL or an INT or something wack |
|
33 | - return $value_inputted_for_field_on_model_object; |
|
34 | - } |
|
35 | - } |
|
25 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
26 | + { |
|
27 | + $value_inputted_for_field_on_model_object = EEH_Array::maybe_unserialize($value_inputted_for_field_on_model_object); |
|
28 | + if (is_string($value_inputted_for_field_on_model_object)) { |
|
29 | + return parent::prepare_for_set($value_inputted_for_field_on_model_object); |
|
30 | + } elseif (is_array($value_inputted_for_field_on_model_object)) { |
|
31 | + return array_map(array($this, 'prepare_for_set'), $value_inputted_for_field_on_model_object); |
|
32 | + } else {//so they passed NULL or an INT or something wack |
|
33 | + return $value_inputted_for_field_on_model_object; |
|
34 | + } |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Value provided should definetely be a serialized string. We should unserialize into an array |
|
39 | - * |
|
40 | - * @param string $value_found_in_db_for_model_object |
|
41 | - * @return array |
|
42 | - */ |
|
43 | - function prepare_for_set_from_db($value_found_in_db_for_model_object) |
|
44 | - { |
|
45 | - return EEH_Array::maybe_unserialize($value_found_in_db_for_model_object); |
|
46 | - } |
|
37 | + /** |
|
38 | + * Value provided should definetely be a serialized string. We should unserialize into an array |
|
39 | + * |
|
40 | + * @param string $value_found_in_db_for_model_object |
|
41 | + * @return array |
|
42 | + */ |
|
43 | + function prepare_for_set_from_db($value_found_in_db_for_model_object) |
|
44 | + { |
|
45 | + return EEH_Array::maybe_unserialize($value_found_in_db_for_model_object); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Gets a string representation of the array |
|
50 | - * |
|
51 | - * @param type $value_on_field_to_be_outputted |
|
52 | - * @param string $schema , possible values are ',', others can be added |
|
53 | - * @return string |
|
54 | - */ |
|
55 | - function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) |
|
56 | - { |
|
57 | - switch ($schema) { |
|
58 | - case 'print_r': |
|
59 | - $pretty_value = print_r($value_on_field_to_be_outputted, true); |
|
60 | - break; |
|
61 | - case 'as_table': |
|
62 | - $pretty_value = EEH_Template::layout_array_as_table($value_on_field_to_be_outputted); |
|
63 | - break; |
|
64 | - default: |
|
65 | - $pretty_value = implode(", ", $value_on_field_to_be_outputted); |
|
66 | - } |
|
67 | - return $pretty_value; |
|
68 | - } |
|
48 | + /** |
|
49 | + * Gets a string representation of the array |
|
50 | + * |
|
51 | + * @param type $value_on_field_to_be_outputted |
|
52 | + * @param string $schema , possible values are ',', others can be added |
|
53 | + * @return string |
|
54 | + */ |
|
55 | + function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) |
|
56 | + { |
|
57 | + switch ($schema) { |
|
58 | + case 'print_r': |
|
59 | + $pretty_value = print_r($value_on_field_to_be_outputted, true); |
|
60 | + break; |
|
61 | + case 'as_table': |
|
62 | + $pretty_value = EEH_Template::layout_array_as_table($value_on_field_to_be_outputted); |
|
63 | + break; |
|
64 | + default: |
|
65 | + $pretty_value = implode(", ", $value_on_field_to_be_outputted); |
|
66 | + } |
|
67 | + return $pretty_value; |
|
68 | + } |
|
69 | 69 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Text_Field_Base.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Text_Field_Base.php'); |
|
3 | 3 | |
4 | 4 | class EE_Plain_Text_Field extends EE_Text_Field_Base |
5 | 5 | { |
@@ -9,15 +9,15 @@ |
||
9 | 9 | */ |
10 | 10 | abstract class EE_DB_Only_Field_Base extends EE_Model_Field_Base |
11 | 11 | { |
12 | - /** |
|
13 | - * All these children classes are for the db-only (meaning, we should select them |
|
14 | - * on get_all queries, update, delete, and will still want to set their default value |
|
15 | - * on inserts, but the model object won't have reference to these fields) |
|
16 | - * |
|
17 | - * @return boolean |
|
18 | - */ |
|
19 | - function is_db_only_field() |
|
20 | - { |
|
21 | - return true; |
|
22 | - } |
|
12 | + /** |
|
13 | + * All these children classes are for the db-only (meaning, we should select them |
|
14 | + * on get_all queries, update, delete, and will still want to set their default value |
|
15 | + * on inserts, but the model object won't have reference to these fields) |
|
16 | + * |
|
17 | + * @return boolean |
|
18 | + */ |
|
19 | + function is_db_only_field() |
|
20 | + { |
|
21 | + return true; |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -9,35 +9,35 @@ |
||
9 | 9 | class EE_Email_Field extends EE_Text_Field_Base |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * In form inputs, we should have called htmlentities and addslashes() on form inputs, |
|
14 | - * so we need to undo that on setting of these fields |
|
15 | - * |
|
16 | - * @param string $email_address |
|
17 | - * @return string |
|
18 | - */ |
|
19 | - function prepare_for_set($email_address) |
|
20 | - { |
|
21 | - $validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level) |
|
22 | - ? EE_Registry::instance()->CFG->registration->email_validation_level |
|
23 | - : 'wp_default'; |
|
24 | - if ($validation_level === 'basic' && ! preg_match('/^.+\@\S+$/', $email_address)) { |
|
25 | - // email not even in correct {string}@{string} format |
|
26 | - return ''; |
|
27 | - } else if ($validation_level === 'wp_default' && ! is_email($email_address)) { |
|
28 | - //not a valid email. |
|
29 | - return ''; |
|
30 | - } else if ( |
|
31 | - ($validation_level === 'i18n' || $validation_level === 'i18n_dns') |
|
32 | - // plz see http://stackoverflow.com/a/24817336 re: the following regex |
|
33 | - && ! preg_match( |
|
34 | - '/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\.!#$%&\'*+-\/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\-\.\d]+)((\.([a-zA-Z\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}]){2,63})+)$/u', |
|
35 | - $email_address |
|
36 | - ) |
|
37 | - ) { |
|
38 | - //not a valid email. |
|
39 | - return ''; |
|
40 | - } |
|
41 | - return $email_address; |
|
42 | - } |
|
12 | + /** |
|
13 | + * In form inputs, we should have called htmlentities and addslashes() on form inputs, |
|
14 | + * so we need to undo that on setting of these fields |
|
15 | + * |
|
16 | + * @param string $email_address |
|
17 | + * @return string |
|
18 | + */ |
|
19 | + function prepare_for_set($email_address) |
|
20 | + { |
|
21 | + $validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level) |
|
22 | + ? EE_Registry::instance()->CFG->registration->email_validation_level |
|
23 | + : 'wp_default'; |
|
24 | + if ($validation_level === 'basic' && ! preg_match('/^.+\@\S+$/', $email_address)) { |
|
25 | + // email not even in correct {string}@{string} format |
|
26 | + return ''; |
|
27 | + } else if ($validation_level === 'wp_default' && ! is_email($email_address)) { |
|
28 | + //not a valid email. |
|
29 | + return ''; |
|
30 | + } else if ( |
|
31 | + ($validation_level === 'i18n' || $validation_level === 'i18n_dns') |
|
32 | + // plz see http://stackoverflow.com/a/24817336 re: the following regex |
|
33 | + && ! preg_match( |
|
34 | + '/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\.!#$%&\'*+-\/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\-\.\d]+)((\.([a-zA-Z\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}]){2,63})+)$/u', |
|
35 | + $email_address |
|
36 | + ) |
|
37 | + ) { |
|
38 | + //not a valid email. |
|
39 | + return ''; |
|
40 | + } |
|
41 | + return $email_address; |
|
42 | + } |
|
43 | 43 | } |
@@ -6,41 +6,41 @@ |
||
6 | 6 | */ |
7 | 7 | abstract class EE_Text_Field_Base extends EE_Model_Field_Base |
8 | 8 | { |
9 | - function get_wpdb_data_type() |
|
10 | - { |
|
11 | - return '%s'; |
|
12 | - } |
|
9 | + function get_wpdb_data_type() |
|
10 | + { |
|
11 | + return '%s'; |
|
12 | + } |
|
13 | 13 | |
14 | - function prepare_for_get($value_of_field_on_model_object) |
|
15 | - { |
|
16 | - return is_string($value_of_field_on_model_object) ? stripslashes($value_of_field_on_model_object) : $value_of_field_on_model_object; |
|
17 | - } |
|
14 | + function prepare_for_get($value_of_field_on_model_object) |
|
15 | + { |
|
16 | + return is_string($value_of_field_on_model_object) ? stripslashes($value_of_field_on_model_object) : $value_of_field_on_model_object; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * Accepts schema of 'form_input' which formats the string for echoing in form input's value. |
|
21 | - * |
|
22 | - * @param string $value_on_field_to_be_outputted |
|
23 | - * @param string $schema |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) |
|
27 | - { |
|
28 | - if ($schema == 'form_input') { |
|
29 | - $value_on_field_to_be_outputted = htmlentities($value_on_field_to_be_outputted, ENT_QUOTES, 'UTF-8'); |
|
30 | - } |
|
31 | - return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema); |
|
32 | - } |
|
19 | + /** |
|
20 | + * Accepts schema of 'form_input' which formats the string for echoing in form input's value. |
|
21 | + * |
|
22 | + * @param string $value_on_field_to_be_outputted |
|
23 | + * @param string $schema |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) |
|
27 | + { |
|
28 | + if ($schema == 'form_input') { |
|
29 | + $value_on_field_to_be_outputted = htmlentities($value_on_field_to_be_outputted, ENT_QUOTES, 'UTF-8'); |
|
30 | + } |
|
31 | + return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * In form inputs, we should have called htmlentities and addslashes on form inputs, |
|
36 | - * so we need to undo that on setting of these fields |
|
37 | - * |
|
38 | - * @param string $value_inputted_for_field_on_model_object |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
42 | - { |
|
43 | - return stripslashes(html_entity_decode(parent::prepare_for_set($value_inputted_for_field_on_model_object), |
|
44 | - ENT_QUOTES, 'UTF-8')); |
|
45 | - } |
|
34 | + /** |
|
35 | + * In form inputs, we should have called htmlentities and addslashes on form inputs, |
|
36 | + * so we need to undo that on setting of these fields |
|
37 | + * |
|
38 | + * @param string $value_inputted_for_field_on_model_object |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
42 | + { |
|
43 | + return stripslashes(html_entity_decode(parent::prepare_for_set($value_inputted_for_field_on_model_object), |
|
44 | + ENT_QUOTES, 'UTF-8')); |
|
45 | + } |
|
46 | 46 | } |
47 | 47 | \ No newline at end of file |
@@ -3,14 +3,14 @@ |
||
3 | 3 | |
4 | 4 | class EE_Plain_Text_Field extends EE_Text_Field_Base |
5 | 5 | { |
6 | - /** |
|
7 | - * removes all tags when setting |
|
8 | - * |
|
9 | - * @param string $value_inputted_for_field_on_model_object |
|
10 | - * @return string |
|
11 | - */ |
|
12 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
13 | - { |
|
14 | - return wp_strip_all_tags(parent::prepare_for_set($value_inputted_for_field_on_model_object)); |
|
15 | - } |
|
6 | + /** |
|
7 | + * removes all tags when setting |
|
8 | + * |
|
9 | + * @param string $value_inputted_for_field_on_model_object |
|
10 | + * @return string |
|
11 | + */ |
|
12 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
13 | + { |
|
14 | + return wp_strip_all_tags(parent::prepare_for_set($value_inputted_for_field_on_model_object)); |
|
15 | + } |
|
16 | 16 | } |
17 | 17 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Text_Field_Base.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Text_Field_Base.php'); |
|
3 | 3 | |
4 | 4 | class EE_Plain_Text_Field extends EE_Text_Field_Base |
5 | 5 | { |
@@ -3,38 +3,38 @@ |
||
3 | 3 | |
4 | 4 | class EE_Boolean_Field extends EE_Integer_Field |
5 | 5 | { |
6 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
7 | - { |
|
8 | - if ($value_inputted_for_field_on_model_object) { |
|
9 | - return true; |
|
10 | - } else { |
|
11 | - return false; |
|
12 | - } |
|
13 | - } |
|
6 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
7 | + { |
|
8 | + if ($value_inputted_for_field_on_model_object) { |
|
9 | + return true; |
|
10 | + } else { |
|
11 | + return false; |
|
12 | + } |
|
13 | + } |
|
14 | 14 | |
15 | - /** |
|
16 | - * Make sure we're returning booleans |
|
17 | - * |
|
18 | - * @param string $value_inputted_for_field_on_model_object |
|
19 | - * @return boolean |
|
20 | - */ |
|
21 | - function prepare_for_set_from_db($value_inputted_for_field_on_model_object) |
|
22 | - { |
|
23 | - return intval($value_inputted_for_field_on_model_object) ? true : false; |
|
24 | - } |
|
15 | + /** |
|
16 | + * Make sure we're returning booleans |
|
17 | + * |
|
18 | + * @param string $value_inputted_for_field_on_model_object |
|
19 | + * @return boolean |
|
20 | + */ |
|
21 | + function prepare_for_set_from_db($value_inputted_for_field_on_model_object) |
|
22 | + { |
|
23 | + return intval($value_inputted_for_field_on_model_object) ? true : false; |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Gets a nice Yes/No value for this field |
|
28 | - * |
|
29 | - * @param boolean $value_on_field_to_be_outputted |
|
30 | - * @return string Yes or No |
|
31 | - */ |
|
32 | - function prepare_for_pretty_echoing($value_on_field_to_be_outputted) |
|
33 | - { |
|
34 | - return apply_filters( |
|
35 | - 'FHEE__EE_Boolean_Field__prepare_for_pretty_echoing__return', |
|
36 | - $value_on_field_to_be_outputted ? __('Yes', 'event_espresso') : __('No', 'event_espresso'), |
|
37 | - $value_on_field_to_be_outputted |
|
38 | - ); |
|
39 | - } |
|
26 | + /** |
|
27 | + * Gets a nice Yes/No value for this field |
|
28 | + * |
|
29 | + * @param boolean $value_on_field_to_be_outputted |
|
30 | + * @return string Yes or No |
|
31 | + */ |
|
32 | + function prepare_for_pretty_echoing($value_on_field_to_be_outputted) |
|
33 | + { |
|
34 | + return apply_filters( |
|
35 | + 'FHEE__EE_Boolean_Field__prepare_for_pretty_echoing__return', |
|
36 | + $value_on_field_to_be_outputted ? __('Yes', 'event_espresso') : __('No', 'event_espresso'), |
|
37 | + $value_on_field_to_be_outputted |
|
38 | + ); |
|
39 | + } |
|
40 | 40 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Integer_Field.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Integer_Field.php'); |
|
3 | 3 | |
4 | 4 | class EE_Boolean_Field extends EE_Integer_Field |
5 | 5 | { |