Completed
Branch BUG-10489-non-trashed-regs-onl... (b37a8e)
by
unknown
37:13 queued 23:24
created
core/entities/models/JsonModelSchema.php 3 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,6 @@  discard block
 block discarded – undo
39 39
 
40 40
     /**
41 41
      * Return the schema for a given model from a given model.
42
-     * @param \EEM_Base $model
43 42
      * @return array
44 43
      */
45 44
     public function getModelSchema()
@@ -103,7 +102,6 @@  discard block
 block discarded – undo
103 102
 
104 103
     /**
105 104
      * Outputs the schema header for a model.
106
-     * @param \EEM_Base $model
107 105
      * @return array
108 106
      */
109 107
     public function getInitialSchemaStructure()
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function getModelSchemaForFields(array $model_fields, array $schema)
65 65
     {
66 66
         foreach ($model_fields as $field => $model_field) {
67
-            if (! $model_field instanceof EE_Model_Field_Base) {
67
+            if ( ! $model_field instanceof EE_Model_Field_Base) {
68 68
                 continue;
69 69
             }
70 70
             $schema['properties'][$field] = $model_field->getSchema();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     public function getModelSchemaForRelations(array $relations_on_model, array $schema)
96 96
     {
97 97
         foreach ($relations_on_model as $model_name => $relation) {
98
-            if (! $relation instanceof EE_Model_Relation_Base) {
98
+            if ( ! $relation instanceof EE_Model_Relation_Base) {
99 99
                 continue;
100 100
             }
101 101
             $model_name_for_schema = $relation instanceof EE_Belongs_To_Relation
Please login to merge, or discard this patch.
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -25,120 +25,120 @@
 block discarded – undo
25 25
 class JsonModelSchema
26 26
 {
27 27
 
28
-    /**
29
-     * @var \EEM_Base
30
-     */
31
-    protected $model;
32
-
33
-    /**
34
-     * JsonModelSchema constructor.
35
-     *
36
-     * @param \EEM_Base $model
37
-     */
38
-    public function __construct(EEM_Base $model)
39
-    {
40
-        $this->model = $model;
41
-    }
42
-
43
-    /**
44
-     * Return the schema for a given model from a given model.
45
-     * @param \EEM_Base $model
46
-     * @return array
47
-     */
48
-    public function getModelSchema()
49
-    {
50
-        return $this->getModelSchemaForRelations(
51
-            $this->model->relation_settings(),
52
-            $this->getModelSchemaForFields(
53
-                $this->model->field_settings(),
54
-                $this->getInitialSchemaStructure()
55
-            )
56
-        );
57
-    }
58
-
59
-
60
-    /**
61
-     * Get the schema for a given set of model fields.
62
-     * @param \EE_Model_Field_Base[]     $model_fields
63
-     * @return array
64
-     */
65
-    public function getModelSchemaForFields(array $model_fields, array $schema)
66
-    {
67
-        foreach ($model_fields as $field => $model_field) {
68
-            if (! $model_field instanceof EE_Model_Field_Base) {
69
-                continue;
70
-            }
71
-            $schema['properties'][$field] = $model_field->getSchema();
72
-
73
-            //if this is a primary key field add the primary key item
74
-            if ($model_field instanceof EE_Primary_Key_Field_Base) {
75
-                $schema['properties'][$field]['primary_key'] = true;
76
-                if ($model_field instanceof EE_Primary_Key_Int_Field) {
77
-                    $schema['properties'][$field]['readonly'] = true;
78
-                }
79
-            }
80
-
81
-            //if this is a foreign key field add the foreign key item
82
-            if ($model_field instanceof EE_Foreign_Key_Field_Base) {
83
-                $schema['properties'][$field]['foreign_key'] = array(
84
-                    'description' => esc_html__('This is a foreign key the points to the given models.', 'event_espresso'),
85
-                    'type' => 'array',
86
-                    'enum' => $model_field->get_model_class_names_pointed_to()
87
-                );
88
-            }
89
-        }
90
-        return $schema;
91
-    }
92
-
93
-
94
-    /**
95
-     * Get the schema for a given set of model relations
96
-     * @param EE_Model_Relation_Base[] $relations_on_model
97
-     * @return array
98
-     */
99
-    public function getModelSchemaForRelations(array $relations_on_model, array $schema)
100
-    {
101
-        foreach ($relations_on_model as $model_name => $relation) {
102
-            if (! $relation instanceof EE_Model_Relation_Base) {
103
-                continue;
104
-            }
105
-            $model_name_for_schema = $relation instanceof EE_Belongs_To_Relation
106
-                ? strtolower($model_name)
107
-                : EEH_Inflector::pluralize_and_lower($model_name);
108
-            $schema['properties'][$model_name_for_schema] = $relation->getSchema();
109
-            $schema['properties'][$model_name_for_schema]['relation_model'] = $model_name;
110
-        }
111
-        return $schema;
112
-    }
113
-
114
-
115
-    /**
116
-     * Outputs the schema header for a model.
117
-     * @param \EEM_Base $model
118
-     * @return array
119
-     */
120
-    public function getInitialSchemaStructure()
121
-    {
122
-        return array(
123
-            '$schema' => 'http://json-schema.org/draft-04/schema#',
124
-            'title' => $this->model->get_this_model_name(),
125
-            'type' => 'object',
126
-            'properties' => array()
127
-        );
128
-    }
129
-
130
-
131
-    /**
132
-     * Allows one to just use the object as a string to get the json.
133
-     * eg.
134
-     *
135
-     * $json_schema = new JsonModelSchema(EEM_Event::instance());
136
-     * echo $json_schema; //outputs the schema as a json formatted string.
137
-     *
138
-     * @return bool|false|mixed|string
139
-     */
140
-    public function __toString()
141
-    {
142
-        return wp_json_encode($this->getModelSchema());
143
-    }
28
+	/**
29
+	 * @var \EEM_Base
30
+	 */
31
+	protected $model;
32
+
33
+	/**
34
+	 * JsonModelSchema constructor.
35
+	 *
36
+	 * @param \EEM_Base $model
37
+	 */
38
+	public function __construct(EEM_Base $model)
39
+	{
40
+		$this->model = $model;
41
+	}
42
+
43
+	/**
44
+	 * Return the schema for a given model from a given model.
45
+	 * @param \EEM_Base $model
46
+	 * @return array
47
+	 */
48
+	public function getModelSchema()
49
+	{
50
+		return $this->getModelSchemaForRelations(
51
+			$this->model->relation_settings(),
52
+			$this->getModelSchemaForFields(
53
+				$this->model->field_settings(),
54
+				$this->getInitialSchemaStructure()
55
+			)
56
+		);
57
+	}
58
+
59
+
60
+	/**
61
+	 * Get the schema for a given set of model fields.
62
+	 * @param \EE_Model_Field_Base[]     $model_fields
63
+	 * @return array
64
+	 */
65
+	public function getModelSchemaForFields(array $model_fields, array $schema)
66
+	{
67
+		foreach ($model_fields as $field => $model_field) {
68
+			if (! $model_field instanceof EE_Model_Field_Base) {
69
+				continue;
70
+			}
71
+			$schema['properties'][$field] = $model_field->getSchema();
72
+
73
+			//if this is a primary key field add the primary key item
74
+			if ($model_field instanceof EE_Primary_Key_Field_Base) {
75
+				$schema['properties'][$field]['primary_key'] = true;
76
+				if ($model_field instanceof EE_Primary_Key_Int_Field) {
77
+					$schema['properties'][$field]['readonly'] = true;
78
+				}
79
+			}
80
+
81
+			//if this is a foreign key field add the foreign key item
82
+			if ($model_field instanceof EE_Foreign_Key_Field_Base) {
83
+				$schema['properties'][$field]['foreign_key'] = array(
84
+					'description' => esc_html__('This is a foreign key the points to the given models.', 'event_espresso'),
85
+					'type' => 'array',
86
+					'enum' => $model_field->get_model_class_names_pointed_to()
87
+				);
88
+			}
89
+		}
90
+		return $schema;
91
+	}
92
+
93
+
94
+	/**
95
+	 * Get the schema for a given set of model relations
96
+	 * @param EE_Model_Relation_Base[] $relations_on_model
97
+	 * @return array
98
+	 */
99
+	public function getModelSchemaForRelations(array $relations_on_model, array $schema)
100
+	{
101
+		foreach ($relations_on_model as $model_name => $relation) {
102
+			if (! $relation instanceof EE_Model_Relation_Base) {
103
+				continue;
104
+			}
105
+			$model_name_for_schema = $relation instanceof EE_Belongs_To_Relation
106
+				? strtolower($model_name)
107
+				: EEH_Inflector::pluralize_and_lower($model_name);
108
+			$schema['properties'][$model_name_for_schema] = $relation->getSchema();
109
+			$schema['properties'][$model_name_for_schema]['relation_model'] = $model_name;
110
+		}
111
+		return $schema;
112
+	}
113
+
114
+
115
+	/**
116
+	 * Outputs the schema header for a model.
117
+	 * @param \EEM_Base $model
118
+	 * @return array
119
+	 */
120
+	public function getInitialSchemaStructure()
121
+	{
122
+		return array(
123
+			'$schema' => 'http://json-schema.org/draft-04/schema#',
124
+			'title' => $this->model->get_this_model_name(),
125
+			'type' => 'object',
126
+			'properties' => array()
127
+		);
128
+	}
129
+
130
+
131
+	/**
132
+	 * Allows one to just use the object as a string to get the json.
133
+	 * eg.
134
+	 *
135
+	 * $json_schema = new JsonModelSchema(EEM_Event::instance());
136
+	 * echo $json_schema; //outputs the schema as a json formatted string.
137
+	 *
138
+	 * @return bool|false|mixed|string
139
+	 */
140
+	public function __toString()
141
+	{
142
+		return wp_json_encode($this->getModelSchema());
143
+	}
144 144
 }
Please login to merge, or discard this patch.
core/entities/interfaces/HasSchemaInterface.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -5,63 +5,63 @@
 block discarded – undo
5 5
 
6 6
 interface HasSchemaInterface
7 7
 {
8
-    /**
9
-     * Returns whatever is set as the nicename for the object.
10
-     *
11
-     * @return string
12
-     */
13
-    public function getSchemaDescription();
8
+	/**
9
+	 * Returns whatever is set as the nicename for the object.
10
+	 *
11
+	 * @return string
12
+	 */
13
+	public function getSchemaDescription();
14 14
 
15 15
 
16
-    /**
17
-     * Returns whatever is set as the $_schema_type property for the object.
18
-     * Note: this will automatically add 'null' to the schema if the object is_nullable()
19
-     *
20
-     * @return string|array
21
-     */
22
-    public function getSchemaType();
16
+	/**
17
+	 * Returns whatever is set as the $_schema_type property for the object.
18
+	 * Note: this will automatically add 'null' to the schema if the object is_nullable()
19
+	 *
20
+	 * @return string|array
21
+	 */
22
+	public function getSchemaType();
23 23
 
24 24
 
25
-    /**
26
-     * This is usually present when the $_schema_type property is 'object'.  Any child classes will need to override
27
-     * this method and return the properties for the schema.
28
-     * The reason this is not a property on the class is because there may be filters set on the values for the property
29
-     * that won't be exposed on construct.  For example enum type schemas may have the enum values filtered.
30
-     *
31
-     * @return array
32
-     */
33
-    public function getSchemaProperties();
25
+	/**
26
+	 * This is usually present when the $_schema_type property is 'object'.  Any child classes will need to override
27
+	 * this method and return the properties for the schema.
28
+	 * The reason this is not a property on the class is because there may be filters set on the values for the property
29
+	 * that won't be exposed on construct.  For example enum type schemas may have the enum values filtered.
30
+	 *
31
+	 * @return array
32
+	 */
33
+	public function getSchemaProperties();
34 34
 
35
-    /**
36
-     * If a child class has enum values, they should override this method and provide a simple array
37
-     * of the enum values.
38
-     * The reason this is not a property on the class is because there may be filterable enum values that
39
-     * are set on the instantiated object that could be filtered after construct.
40
-     *
41
-     * @return array
42
-     */
43
-    public function getSchemaEnum();
35
+	/**
36
+	 * If a child class has enum values, they should override this method and provide a simple array
37
+	 * of the enum values.
38
+	 * The reason this is not a property on the class is because there may be filterable enum values that
39
+	 * are set on the instantiated object that could be filtered after construct.
40
+	 *
41
+	 * @return array
42
+	 */
43
+	public function getSchemaEnum();
44 44
 
45
-    /**
46
-     * This returns the value of the $_schema_format property on the object.
47
-     *
48
-     * @return string
49
-     */
50
-    public function getSchemaFormat();
45
+	/**
46
+	 * This returns the value of the $_schema_format property on the object.
47
+	 *
48
+	 * @return string
49
+	 */
50
+	public function getSchemaFormat();
51 51
 
52
-    /**
53
-     * This returns the value of the $_schema_readonly property on the object.
54
-     *
55
-     * @return bool
56
-     */
57
-    public function getSchemaReadonly();
52
+	/**
53
+	 * This returns the value of the $_schema_readonly property on the object.
54
+	 *
55
+	 * @return bool
56
+	 */
57
+	public function getSchemaReadonly();
58 58
 
59 59
 
60
-    /**
61
-     * This returns elements used to represent this field in the json schema.
62
-     *
63
-     * @link http://json-schema.org/
64
-     * @return array
65
-     */
66
-    public function getSchema();
60
+	/**
61
+	 * This returns elements used to represent this field in the json schema.
62
+	 *
63
+	 * @link http://json-schema.org/
64
+	 * @return array
65
+	 */
66
+	public function getSchema();
67 67
 }
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/fields/EE_Text_Field_Base.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -7,36 +7,36 @@
 block discarded – undo
7 7
 abstract class EE_Text_Field_Base extends EE_Model_Field_Base
8 8
 {
9 9
 
10
-    function prepare_for_get($value_of_field_on_model_object)
11
-    {
12
-        return is_string($value_of_field_on_model_object) ? stripslashes($value_of_field_on_model_object) : $value_of_field_on_model_object;
13
-    }
10
+	function prepare_for_get($value_of_field_on_model_object)
11
+	{
12
+		return is_string($value_of_field_on_model_object) ? stripslashes($value_of_field_on_model_object) : $value_of_field_on_model_object;
13
+	}
14 14
 
15
-    /**
16
-     * Accepts schema of 'form_input' which formats the string for echoing in form input's value.
17
-     *
18
-     * @param string $value_on_field_to_be_outputted
19
-     * @param string $schema
20
-     * @return string
21
-     */
22
-    function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
23
-    {
24
-        if ($schema == 'form_input') {
25
-            $value_on_field_to_be_outputted = htmlentities($value_on_field_to_be_outputted, ENT_QUOTES, 'UTF-8');
26
-        }
27
-        return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
28
-    }
15
+	/**
16
+	 * Accepts schema of 'form_input' which formats the string for echoing in form input's value.
17
+	 *
18
+	 * @param string $value_on_field_to_be_outputted
19
+	 * @param string $schema
20
+	 * @return string
21
+	 */
22
+	function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
23
+	{
24
+		if ($schema == 'form_input') {
25
+			$value_on_field_to_be_outputted = htmlentities($value_on_field_to_be_outputted, ENT_QUOTES, 'UTF-8');
26
+		}
27
+		return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
28
+	}
29 29
 
30
-    /**
31
-     * In form inputs, we should have called htmlentities and addslashes on form inputs,
32
-     * so we need to undo that on setting of these fields
33
-     *
34
-     * @param string $value_inputted_for_field_on_model_object
35
-     * @return string
36
-     */
37
-    function prepare_for_set($value_inputted_for_field_on_model_object)
38
-    {
39
-        return stripslashes(html_entity_decode(parent::prepare_for_set($value_inputted_for_field_on_model_object),
40
-            ENT_QUOTES, 'UTF-8'));
41
-    }
30
+	/**
31
+	 * In form inputs, we should have called htmlentities and addslashes on form inputs,
32
+	 * so we need to undo that on setting of these fields
33
+	 *
34
+	 * @param string $value_inputted_for_field_on_model_object
35
+	 * @return string
36
+	 */
37
+	function prepare_for_set($value_inputted_for_field_on_model_object)
38
+	{
39
+		return stripslashes(html_entity_decode(parent::prepare_for_set($value_inputted_for_field_on_model_object),
40
+			ENT_QUOTES, 'UTF-8'));
41
+	}
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/fields/EE_Primary_Key_String_Field.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,22 +4,22 @@
 block discarded – undo
4 4
 class EE_Primary_Key_String_Field extends EE_Primary_Key_Field_Base
5 5
 {
6 6
 
7
-    public function __construct($table_column, $nicename)
8
-    {
9
-        parent::__construct($table_column, $nicename, null);
10
-    }
7
+	public function __construct($table_column, $nicename)
8
+	{
9
+		parent::__construct($table_column, $nicename, null);
10
+	}
11 11
 
12
-    /**
13
-     * removes all tags when setting
14
-     *
15
-     * @param string $value_inputted_for_field_on_model_object
16
-     * @return string
17
-     */
18
-    function prepare_for_set($value_inputted_for_field_on_model_object)
19
-    {
20
-        if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
21
-            $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
22
-        }
23
-        return wp_strip_all_tags($value_inputted_for_field_on_model_object);
24
-    }
12
+	/**
13
+	 * removes all tags when setting
14
+	 *
15
+	 * @param string $value_inputted_for_field_on_model_object
16
+	 * @return string
17
+	 */
18
+	function prepare_for_set($value_inputted_for_field_on_model_object)
19
+	{
20
+		if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
21
+			$value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
22
+		}
23
+		return wp_strip_all_tags($value_inputted_for_field_on_model_object);
24
+	}
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -4,6 +4,9 @@
 block discarded – undo
4 4
 class EE_Primary_Key_String_Field extends EE_Primary_Key_Field_Base
5 5
 {
6 6
 
7
+    /**
8
+     * @param string $table_column
9
+     */
7 10
     public function __construct($table_column, $nicename)
8 11
     {
9 12
         parent::__construct($table_column, $nicename, null);
Please login to merge, or discard this patch.
core/db_models/fields/EE_All_Caps_Text_Field.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
  */
7 7
 class EE_All_Caps_Text_Field extends EE_Text_Field_Base
8 8
 {
9
-    /**
10
-     * makes it all upper case, and key-like
11
-     *
12
-     * @param string $value_inputted_for_field_on_model_object
13
-     * @return string
14
-     */
15
-    function prepare_for_set($value_inputted_for_field_on_model_object)
16
-    {
17
-        return strtoupper(sanitize_key($value_inputted_for_field_on_model_object));
18
-    }
9
+	/**
10
+	 * makes it all upper case, and key-like
11
+	 *
12
+	 * @param string $value_inputted_for_field_on_model_object
13
+	 * @return string
14
+	 */
15
+	function prepare_for_set($value_inputted_for_field_on_model_object)
16
+	{
17
+		return strtoupper(sanitize_key($value_inputted_for_field_on_model_object));
18
+	}
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
reg_steps/attendee_information/attendee_info_main.template.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 /** @var string $default_hidden_inputs */
5 5
 ?>
6 6
 	<p id="spco-attendee_information-pg" class="spco-steps-pg small-text drk-grey-text">
7
-		<?php echo apply_filters( 'FHEE__registration_page_attendee_information__attendee_information_pg', sprintf( __('In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', 'event_espresso'), '<br />', '<span class="asterisk">*</span>' )); ?>
7
+		<?php echo apply_filters('FHEE__registration_page_attendee_information__attendee_information_pg', sprintf(__('In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', 'event_espresso'), '<br />', '<span class="asterisk">*</span>')); ?>
8 8
 	</p>
9 9
 
10 10
 <?php
@@ -12,34 +12,34 @@  discard block
 block discarded – undo
12 12
 $prev_event = 0;
13 13
 $prev_ticket = 0;
14 14
 
15
-if ( count( $registrations ) > 0 ) {
16
-	foreach ( $registrations as $registration ) {
17
-		if ( $registration instanceof EE_Registration ) {
15
+if (count($registrations) > 0) {
16
+	foreach ($registrations as $registration) {
17
+		if ($registration instanceof EE_Registration) {
18 18
 			$att_nmbr++;
19 19
 ?>
20 20
 
21
-		<div id="spco-attendee-panel-dv-<?php echo $registration->reg_url_link();?>" class="spco-attendee-panel-dv spco-attendee-ticket-<?php echo $registration->ticket()->ID();?>">
21
+		<div id="spco-attendee-panel-dv-<?php echo $registration->reg_url_link(); ?>" class="spco-attendee-panel-dv spco-attendee-ticket-<?php echo $registration->ticket()->ID(); ?>">
22 22
 
23
-			<?php if ( $registration->event()->ID() !== $prev_event ) { ?>
23
+			<?php if ($registration->event()->ID() !== $prev_event) { ?>
24 24
 			<h4 id="event_title-<?php echo $registration->event()->ID() ?>" class="big-event-title-hdr">
25 25
 				<?php echo $registration->event()->name(); ?>
26 26
 			</h4>
27 27
 			<?php } ?>
28
-			<?php if ( $registration->ticket()->ID() !== $prev_ticket ) { ?>
29
-				<?php if ( ! $revisit ) { ?>
28
+			<?php if ($registration->ticket()->ID() !== $prev_ticket) { ?>
29
+				<?php if ( ! $revisit) { ?>
30 30
 			<div class="spco-ticket-info-dv small-text">
31
-				<h5><?php _e('Details', 'event_espresso');?></h5>
31
+				<h5><?php _e('Details', 'event_espresso'); ?></h5>
32 32
 				<table>
33 33
 					<thead>
34 34
 						<tr>
35
-							<th scope="col" width=""><?php _e('Name and Description', 'event_espresso');?></th>
36
-							<th scope="col" width="7.5%" class="jst-rght"><?php _e('Qty', 'event_espresso');?></th>
37
-							<th scope="col" width="17.5%" class="jst-rght"><?php _e('Price', 'event_espresso');?></th>
38
-							<th scope="col" width="17.5%" class="jst-rght"><?php _e('Total', 'event_espresso');?></th>
35
+							<th scope="col" width=""><?php _e('Name and Description', 'event_espresso'); ?></th>
36
+							<th scope="col" width="7.5%" class="jst-rght"><?php _e('Qty', 'event_espresso'); ?></th>
37
+							<th scope="col" width="17.5%" class="jst-rght"><?php _e('Price', 'event_espresso'); ?></th>
38
+							<th scope="col" width="17.5%" class="jst-rght"><?php _e('Total', 'event_espresso'); ?></th>
39 39
 						</tr>
40 40
 					</thead>
41 41
 					<tbody>
42
-					<?php echo $ticket_line_item[ $registration->ticket()->ID() ]; ?>
42
+					<?php echo $ticket_line_item[$registration->ticket()->ID()]; ?>
43 43
 					</tbody>
44 44
 				</table>
45 45
 			</div>
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 			<?php
50 50
 			// ATTENDEE QUESTIONS
51
-			$reg_form = EE_Template_Layout::get_subform_name( $registration->reg_url_link() );
51
+			$reg_form = EE_Template_Layout::get_subform_name($registration->reg_url_link());
52 52
 			echo ${$reg_form};
53 53
 			?>
54 54
 
Please login to merge, or discard this patch.
core/db_models/fields/EE_DB_Only_Field_Base.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      * @param string $table_column
16 16
      * @param string $nicename
17 17
      * @param bool   $nullable
18
-     * @param null   $default_value
18
+     * @param string|null   $default_value
19 19
      */
20 20
     public function __construct($table_column, $nicename, $nullable, $default_value = null)
21 21
     {
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 block discarded – undo
11 11
 abstract class EE_DB_Only_Field_Base extends EE_Model_Field_Base
12 12
 {
13 13
 
14
-    /**
15
-     * @param string $table_column
16
-     * @param string $nicename
17
-     * @param bool   $nullable
18
-     * @param null   $default_value
19
-     */
20
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
21
-    {
22
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
23
-        $this->setSchemaReadOnly(true);
24
-    }
14
+	/**
15
+	 * @param string $table_column
16
+	 * @param string $nicename
17
+	 * @param bool   $nullable
18
+	 * @param null   $default_value
19
+	 */
20
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
21
+	{
22
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
23
+		$this->setSchemaReadOnly(true);
24
+	}
25 25
 
26 26
 
27
-    /**
28
-     * All these children classes are for the db-only (meaning, we should select them
29
-     * on get_all queries, update, delete, and will still want to set their default value
30
-     * on inserts, but the model object won't have reference to these fields)
31
-     *
32
-     * @return boolean
33
-     */
34
-    function is_db_only_field()
35
-    {
36
-        return true;
37
-    }
27
+	/**
28
+	 * All these children classes are for the db-only (meaning, we should select them
29
+	 * on get_all queries, update, delete, and will still want to set their default value
30
+	 * on inserts, but the model object won't have reference to these fields)
31
+	 *
32
+	 * @return boolean
33
+	 */
34
+	function is_db_only_field()
35
+	{
36
+		return true;
37
+	}
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/fields/EE_Email_Field.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      * @param string $table_column
14 14
      * @param string $nicename
15 15
      * @param bool   $nullable
16
-     * @param null   $default_value
16
+     * @param string   $default_value
17 17
      */
18 18
     public function __construct($table_column, $nicename, $nullable, $default_value = null)
19 19
     {
Please login to merge, or discard this patch.
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -9,48 +9,48 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Email_Field extends EE_Text_Field_Base
11 11
 {
12
-    /**
13
-     * @param string $table_column
14
-     * @param string $nicename
15
-     * @param bool   $nullable
16
-     * @param null   $default_value
17
-     */
18
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
19
-    {
20
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
21
-        $this->setSchemaFormat('email');
22
-    }
12
+	/**
13
+	 * @param string $table_column
14
+	 * @param string $nicename
15
+	 * @param bool   $nullable
16
+	 * @param null   $default_value
17
+	 */
18
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
19
+	{
20
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
21
+		$this->setSchemaFormat('email');
22
+	}
23 23
 
24 24
 
25
-    /**
26
-     * In form inputs, we should have called htmlentities and addslashes() on form inputs,
27
-     * so we need to undo that on setting of these fields
28
-     *
29
-     * @param string $email_address
30
-     * @return string
31
-     */
32
-    function prepare_for_set($email_address)
33
-    {
34
-        $validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level)
35
-            ? EE_Registry::instance()->CFG->registration->email_validation_level
36
-            : 'wp_default';
37
-        if ($validation_level === 'basic' && ! preg_match('/^.+\@\S+$/', $email_address)) {
38
-            // email not even in correct {string}@{string} format
39
-            return '';
40
-        } else if ($validation_level === 'wp_default' && ! is_email($email_address)) {
41
-            //not a valid email.
42
-            return '';
43
-        } else if (
44
-            ($validation_level === 'i18n' || $validation_level === 'i18n_dns')
45
-            // plz see http://stackoverflow.com/a/24817336 re: the following regex
46
-            && ! preg_match(
47
-                '/^(?!\.)((?!.*\.{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',
48
-                $email_address
49
-            )
50
-        ) {
51
-            //not a valid email.
52
-            return '';
53
-        }
54
-        return $email_address;
55
-    }
25
+	/**
26
+	 * In form inputs, we should have called htmlentities and addslashes() on form inputs,
27
+	 * so we need to undo that on setting of these fields
28
+	 *
29
+	 * @param string $email_address
30
+	 * @return string
31
+	 */
32
+	function prepare_for_set($email_address)
33
+	{
34
+		$validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level)
35
+			? EE_Registry::instance()->CFG->registration->email_validation_level
36
+			: 'wp_default';
37
+		if ($validation_level === 'basic' && ! preg_match('/^.+\@\S+$/', $email_address)) {
38
+			// email not even in correct {string}@{string} format
39
+			return '';
40
+		} else if ($validation_level === 'wp_default' && ! is_email($email_address)) {
41
+			//not a valid email.
42
+			return '';
43
+		} else if (
44
+			($validation_level === 'i18n' || $validation_level === 'i18n_dns')
45
+			// plz see http://stackoverflow.com/a/24817336 re: the following regex
46
+			&& ! preg_match(
47
+				'/^(?!\.)((?!.*\.{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',
48
+				$email_address
49
+			)
50
+		) {
51
+			//not a valid email.
52
+			return '';
53
+		}
54
+		return $email_address;
55
+	}
56 56
 }
Please login to merge, or discard this patch.
core/db_models/fields/EE_Float_Field.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      * @param string $table_column
13 13
      * @param string $nicename
14 14
      * @param bool   $nullable
15
-     * @param null   $default_value
15
+     * @param integer|null   $default_value
16 16
      */
17 17
     public function __construct($table_column, $nicename, $nullable, $default_value = null)
18 18
     {
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * So if you want to pass in a string that NEEDS to interpret periods as decimal marks, call floatval() on it first.
28 28
      * Returns a float
29 29
      *
30
-     * @param type $value_inputted_for_field_on_model_object
30
+     * @param string $value_inputted_for_field_on_model_object
31 31
      * @return float
32 32
      */
33 33
     function prepare_for_set($value_inputted_for_field_on_model_object)
Please login to merge, or discard this patch.
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -8,64 +8,64 @@
 block discarded – undo
8 8
 class EE_Float_Field extends EE_Model_Field_Base
9 9
 {
10 10
 
11
-    /**
12
-     * @param string $table_column
13
-     * @param string $nicename
14
-     * @param bool   $nullable
15
-     * @param null   $default_value
16
-     */
17
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
18
-    {
19
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
20
-        $this->setSchemaType('number');
21
-    }
11
+	/**
12
+	 * @param string $table_column
13
+	 * @param string $nicename
14
+	 * @param bool   $nullable
15
+	 * @param null   $default_value
16
+	 */
17
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
18
+	{
19
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
20
+		$this->setSchemaType('number');
21
+	}
22 22
 
23 23
 
24
-    /**
25
-     * If provided a string, strips out number-related formatting, like commas, periods, spaces, other junk, etc.
26
-     * However, treats commas and periods as thousand-separators ro decimal marks, as indicate by the config's currency.
27
-     * So if you want to pass in a string that NEEDS to interpret periods as decimal marks, call floatval() on it first.
28
-     * Returns a float
29
-     *
30
-     * @param type $value_inputted_for_field_on_model_object
31
-     * @return float
32
-     */
33
-    function prepare_for_set($value_inputted_for_field_on_model_object)
34
-    {
24
+	/**
25
+	 * If provided a string, strips out number-related formatting, like commas, periods, spaces, other junk, etc.
26
+	 * However, treats commas and periods as thousand-separators ro decimal marks, as indicate by the config's currency.
27
+	 * So if you want to pass in a string that NEEDS to interpret periods as decimal marks, call floatval() on it first.
28
+	 * Returns a float
29
+	 *
30
+	 * @param type $value_inputted_for_field_on_model_object
31
+	 * @return float
32
+	 */
33
+	function prepare_for_set($value_inputted_for_field_on_model_object)
34
+	{
35 35
 //		echo __LINE__."$value_inputted_for_field_on_model_object<br>";
36
-        //remove whitespaces and thousands separators
37
-        if (is_string($value_inputted_for_field_on_model_object)) {
38
-            $value_inputted_for_field_on_model_object = str_replace(array(" ", EE_Config::instance()->currency->thsnds),
39
-                "", $value_inputted_for_field_on_model_object);
36
+		//remove whitespaces and thousands separators
37
+		if (is_string($value_inputted_for_field_on_model_object)) {
38
+			$value_inputted_for_field_on_model_object = str_replace(array(" ", EE_Config::instance()->currency->thsnds),
39
+				"", $value_inputted_for_field_on_model_object);
40 40
 //echo __LINE__."$value_inputted_for_field_on_model_object<br>";
41 41
 //normalize it so periods are decimal marks (we don't care where you're from: we're talking PHP now)
42
-            $value_inputted_for_field_on_model_object = str_replace(EE_Config::instance()->currency->dec_mrk, ".",
43
-                $value_inputted_for_field_on_model_object);
42
+			$value_inputted_for_field_on_model_object = str_replace(EE_Config::instance()->currency->dec_mrk, ".",
43
+				$value_inputted_for_field_on_model_object);
44 44
 //echo __LINE__."$value_inputted_for_field_on_model_object<br>";
45 45
 //double-check there's absolutely nothing left on this string besides numbers
46
-            $value_inputted_for_field_on_model_object = preg_replace("/[^0-9,.]/", "",
47
-                $value_inputted_for_field_on_model_object);
48
-        }
46
+			$value_inputted_for_field_on_model_object = preg_replace("/[^0-9,.]/", "",
47
+				$value_inputted_for_field_on_model_object);
48
+		}
49 49
 //		echo __LINE__."$value_inputted_for_field_on_model_object<br>";
50
-        return floatval($value_inputted_for_field_on_model_object);
51
-    }
50
+		return floatval($value_inputted_for_field_on_model_object);
51
+	}
52 52
 
53
-    /**
54
-     * Returns the number formatted according to local custom (set by the country of the blog).
55
-     *
56
-     * @param float $value_on_field_to_be_outputted
57
-     * @return string
58
-     */
59
-    function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
60
-    {
61
-        $EE = EE_Registry::instance();
62
-        return number_format($value_on_field_to_be_outputted, $EE->CFG->currency->dec_plc, $EE->CFG->currency->dec_mrk,
63
-            $EE->CFG->currency->thsnds);
64
-    }
53
+	/**
54
+	 * Returns the number formatted according to local custom (set by the country of the blog).
55
+	 *
56
+	 * @param float $value_on_field_to_be_outputted
57
+	 * @return string
58
+	 */
59
+	function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
60
+	{
61
+		$EE = EE_Registry::instance();
62
+		return number_format($value_on_field_to_be_outputted, $EE->CFG->currency->dec_plc, $EE->CFG->currency->dec_mrk,
63
+			$EE->CFG->currency->thsnds);
64
+	}
65 65
 
66
-    function prepare_for_set_from_db($value_found_in_db_for_model_object)
67
-    {
66
+	function prepare_for_set_from_db($value_found_in_db_for_model_object)
67
+	{
68 68
 //		echo "prepare for set from db of ";d($value_found_in_db_for_model_object);
69
-        return floatval($value_found_in_db_for_model_object);
70
-    }
69
+		return floatval($value_found_in_db_for_model_object);
70
+	}
71 71
 }
72 72
\ No newline at end of file
Please login to merge, or discard this patch.