Completed
Push — master ( 44aca2...0191c7 )
by
unknown
36s
created
redux-core/inc/validation/date/class-redux-validation-date.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -12,43 +12,43 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Date', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Date
17
-	 */
18
-	class Redux_Validation_Date extends Redux_Validate {
19
-
20
-		/**
21
-		 * Field Validation Function.
22
-		 * Takes the vars and validates them.
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'This field must be a valid date.', 'redux-framework' );
28
-
29
-			$string = str_replace( '/', '', $this->value );
30
-
31
-			if ( ! is_numeric( $string ) ) {
32
-				$this->value            = ( isset( $this->current ) ) ? $this->current : '';
33
-				$this->field['current'] = $this->value;
34
-				$this->error            = $this->field;
35
-
36
-				return;
37
-			}
38
-
39
-			if ( '/' !== $this->value[2] ) {
40
-				$this->value            = ( isset( $this->current ) ) ? $this->current : '';
41
-				$this->field['current'] = $this->value;
42
-				$this->error            = $this->field;
43
-
44
-				return;
45
-			}
46
-
47
-			if ( '/' !== $this->value[5] ) {
48
-				$this->value            = ( isset( $this->current ) ) ? $this->current : '';
49
-				$this->field['current'] = $this->value;
50
-				$this->error            = $this->field;
51
-			}
52
-		}
53
-	}
15
+    /**
16
+     * Class Redux_Validation_Date
17
+     */
18
+    class Redux_Validation_Date extends Redux_Validate {
19
+
20
+        /**
21
+         * Field Validation Function.
22
+         * Takes the vars and validates them.
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'This field must be a valid date.', 'redux-framework' );
28
+
29
+            $string = str_replace( '/', '', $this->value );
30
+
31
+            if ( ! is_numeric( $string ) ) {
32
+                $this->value            = ( isset( $this->current ) ) ? $this->current : '';
33
+                $this->field['current'] = $this->value;
34
+                $this->error            = $this->field;
35
+
36
+                return;
37
+            }
38
+
39
+            if ( '/' !== $this->value[2] ) {
40
+                $this->value            = ( isset( $this->current ) ) ? $this->current : '';
41
+                $this->field['current'] = $this->value;
42
+                $this->error            = $this->field;
43
+
44
+                return;
45
+            }
46
+
47
+            if ( '/' !== $this->value[5] ) {
48
+                $this->value            = ( isset( $this->current ) ) ? $this->current : '';
49
+                $this->field['current'] = $this->value;
50
+                $this->error            = $this->field;
51
+            }
52
+        }
53
+    }
54 54
 }
Please login to merge, or discard this patch.
redux-core/inc/validation/no_html/class-redux-validation-no-html.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -12,28 +12,28 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_No_Html', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_No_Html
17
-	 */
18
-	class Redux_Validation_No_Html extends Redux_Validate {
15
+    /**
16
+     * Class Redux_Validation_No_Html
17
+     */
18
+    class Redux_Validation_No_Html extends Redux_Validate {
19 19
 
20
-		/**
21
-		 * Validate Function.
22
-		 * Takes the vars and validates them
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must not enter any HTML in this field.  All HTML has been removed.', 'redux-framework' );
20
+        /**
21
+         * Validate Function.
22
+         * Takes the vars and validates them
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must not enter any HTML in this field.  All HTML has been removed.', 'redux-framework' );
28 28
 
29
-			$newvalue = wp_strip_all_tags( $this->value );
29
+            $newvalue = wp_strip_all_tags( $this->value );
30 30
 
31
-			if ( $this->value !== $newvalue ) {
32
-				$this->field['current'] = $newvalue;
33
-				$this->warning          = $this->field;
34
-			}
31
+            if ( $this->value !== $newvalue ) {
32
+                $this->field['current'] = $newvalue;
33
+                $this->warning          = $this->field;
34
+            }
35 35
 
36
-			$this->value = $newvalue;
37
-		}
38
-	}
36
+            $this->value = $newvalue;
37
+        }
38
+    }
39 39
 }
Please login to merge, or discard this patch.
redux-core/inc/validation/js/class-redux-validation-js.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -12,28 +12,28 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Js', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Js
17
-	 */
18
-	class Redux_Validation_Js extends Redux_Validate {
15
+    /**
16
+     * Class Redux_Validation_Js
17
+     */
18
+    class Redux_Validation_Js extends Redux_Validate {
19 19
 
20
-		/**
21
-		 * Field Validation Function.
22
-		 * Takes the vars and validates them
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'Javascript has been successfully escaped.', 'redux-framework' );
20
+        /**
21
+         * Field Validation Function.
22
+         * Takes the vars and validates them
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'Javascript has been successfully escaped.', 'redux-framework' );
28 28
 
29
-			$js = esc_js( $this->value );
29
+            $js = esc_js( $this->value );
30 30
 
31
-			if ( $js !== $this->value ) {
32
-				$this->field['current'] = $js;
33
-				$this->warning          = $this->field;
34
-			}
31
+            if ( $js !== $this->value ) {
32
+                $this->field['current'] = $js;
33
+                $this->warning          = $this->field;
34
+            }
35 35
 
36
-			$this->value = $js;
37
-		}
38
-	}
36
+            $this->value = $js;
37
+        }
38
+    }
39 39
 }
Please login to merge, or discard this patch.
redux-core/inc/validation/css/class-redux-validation-css.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Css', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Css
17
-	 */
18
-	class Redux_Validation_Css extends Redux_Validate {
19
-
20
-		/**
21
-		 * Field Validation Function.
22
-		 * Takes the vars and validates them
23
-		 *
24
-		 * @since ReduxFramework 3.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'Unsafe strings were found in your CSS and have been filtered out.', 'redux-framework' );
28
-
29
-			$data = $this->value;
30
-
31
-			$data = wp_filter_nohtml_kses( $data );
32
-			$data = str_replace( '>', '>', $data );
33
-			$data = stripslashes( $data );
34
-
35
-			if ( $data !== $this->value ) {
36
-				$this->field['current'] = $data;
37
-				$this->warning          = $this->field;
38
-			}
39
-
40
-			$this->value = $data;
41
-		}
42
-	}
15
+    /**
16
+     * Class Redux_Validation_Css
17
+     */
18
+    class Redux_Validation_Css extends Redux_Validate {
19
+
20
+        /**
21
+         * Field Validation Function.
22
+         * Takes the vars and validates them
23
+         *
24
+         * @since ReduxFramework 3.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'Unsafe strings were found in your CSS and have been filtered out.', 'redux-framework' );
28
+
29
+            $data = $this->value;
30
+
31
+            $data = wp_filter_nohtml_kses( $data );
32
+            $data = str_replace( '>', '>', $data );
33
+            $data = stripslashes( $data );
34
+
35
+            if ( $data !== $this->value ) {
36
+                $this->field['current'] = $data;
37
+                $this->warning          = $this->field;
38
+            }
39
+
40
+            $this->value = $data;
41
+        }
42
+    }
43 43
 }
Please login to merge, or discard this patch.
inc/validation/comma_numeric/class-redux-validation-comma-numeric.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -11,34 +11,34 @@
 block discarded – undo
11 11
 
12 12
 if ( ! class_exists( 'Redux_Validation_Comma_Numeric', false ) ) {
13 13
 
14
-	/**
15
-	 * Class Redux_Validation_Comma_Numeric
16
-	 */
17
-	class Redux_Validation_Comma_Numeric extends Redux_Validate {
18
-
19
-		/**
20
-		 * Field Validation Function.
21
-		 * Takes the vars and outputs the HTML for the field in the settings
22
-		 *
23
-		 * @since ReduxFramework 1.0.0
24
-		 */
25
-		public function validate() {
26
-
27
-			$this->value = preg_replace( '/\s/', '', $this->value );
28
-			$parts       = explode( ',', $this->value );
29
-
30
-			if ( empty( $this->value ) || 0 === $this->value || 1 === count( $parts ) ) {
31
-				return;
32
-			}
33
-
34
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );
35
-
36
-			if ( ! is_numeric( str_replace( ',', '', $this->value ) ) || false === strpos( $this->value, ',' ) ) {
37
-				$this->value            = ( isset( $this->current ) ) ? $this->current : '';
38
-				$this->field['current'] = $this->value;
39
-
40
-				$this->error = $this->field;
41
-			}
42
-		}
43
-	}
14
+    /**
15
+     * Class Redux_Validation_Comma_Numeric
16
+     */
17
+    class Redux_Validation_Comma_Numeric extends Redux_Validate {
18
+
19
+        /**
20
+         * Field Validation Function.
21
+         * Takes the vars and outputs the HTML for the field in the settings
22
+         *
23
+         * @since ReduxFramework 1.0.0
24
+         */
25
+        public function validate() {
26
+
27
+            $this->value = preg_replace( '/\s/', '', $this->value );
28
+            $parts       = explode( ',', $this->value );
29
+
30
+            if ( empty( $this->value ) || 0 === $this->value || 1 === count( $parts ) ) {
31
+                return;
32
+            }
33
+
34
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );
35
+
36
+            if ( ! is_numeric( str_replace( ',', '', $this->value ) ) || false === strpos( $this->value, ',' ) ) {
37
+                $this->value            = ( isset( $this->current ) ) ? $this->current : '';
38
+                $this->field['current'] = $this->value;
39
+
40
+                $this->error = $this->field;
41
+            }
42
+        }
43
+    }
44 44
 }
Please login to merge, or discard this patch.
redux-core/inc/validation/email/class-redux-validation-email.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Email', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Email
17
-	 */
18
-	class Redux_Validation_Email extends Redux_Validate {
15
+    /**
16
+     * Class Redux_Validation_Email
17
+     */
18
+    class Redux_Validation_Email extends Redux_Validate {
19 19
 
20
-		/**
21
-		 * Field Render Function.
22
-		 * Takes the vars and outputs the HTML for the field in the settings
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must provide a valid email for this option.', 'redux-framework' );
20
+        /**
21
+         * Field Render Function.
22
+         * Takes the vars and outputs the HTML for the field in the settings
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must provide a valid email for this option.', 'redux-framework' );
28 28
 
29
-			if ( ! is_email( $this->value ) ) {
30
-				$this->value            = ( isset( $this->current ) ) ? $this->current : '';
31
-				$this->field['current'] = $this->value;
29
+            if ( ! is_email( $this->value ) ) {
30
+                $this->value            = ( isset( $this->current ) ) ? $this->current : '';
31
+                $this->field['current'] = $this->value;
32 32
 
33
-				$this->error = $this->field;
34
-			}
35
-		}
36
-	}
33
+                $this->error = $this->field;
34
+            }
35
+        }
36
+    }
37 37
 }
Please login to merge, or discard this patch.
inc/validation/html_custom/class-redux-validation-html-custom.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -12,30 +12,30 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Html_Custom', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Html_Custom
17
-	 */
18
-	class Redux_Validation_Html_Custom extends Redux_Validate {
15
+    /**
16
+     * Class Redux_Validation_Html_Custom
17
+     */
18
+    class Redux_Validation_Html_Custom extends Redux_Validate {
19 19
 
20
-		/**
21
-		 * Field Render Function.
22
-		 * Takes the vars and validates them
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'Invalid HTML was found in this field and has been removed.', 'redux-framework' );
20
+        /**
21
+         * Field Render Function.
22
+         * Takes the vars and validates them
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'Invalid HTML was found in this field and has been removed.', 'redux-framework' );
28 28
 
29
-			if ( isset( $this->field['allowed_html'] ) ) {
30
-				$html = wp_kses( $this->value, $this->field['allowed_html'] );
29
+            if ( isset( $this->field['allowed_html'] ) ) {
30
+                $html = wp_kses( $this->value, $this->field['allowed_html'] );
31 31
 
32
-				if ( $html !== $this->value ) {
33
-					$this->field['current'] = $html;
34
-					$this->warning          = $this->field;
35
-				}
32
+                if ( $html !== $this->value ) {
33
+                    $this->field['current'] = $html;
34
+                    $this->warning          = $this->field;
35
+                }
36 36
 
37
-				$this->value = $html;
38
-			}
39
-		}
40
-	}
37
+                $this->value = $html;
38
+            }
39
+        }
40
+    }
41 41
 }
Please login to merge, or discard this patch.
redux-core/inc/validation/url/class-redux-validation-url.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,28 +12,28 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Url', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Url
17
-	 */
18
-	class Redux_Validation_Url extends Redux_Validate {
15
+    /**
16
+     * Class Redux_Validation_Url
17
+     */
18
+    class Redux_Validation_Url extends Redux_Validate {
19 19
 
20
-		/**
21
-		 * Field Render Function.
22
-		 * Takes the vars and validates them
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must provide a valid URL for this option.', 'redux-framework' );
20
+        /**
21
+         * Field Render Function.
22
+         * Takes the vars and validates them
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must provide a valid URL for this option.', 'redux-framework' );
28 28
 
29
-			if ( false === filter_var( $this->value, FILTER_VALIDATE_URL ) ) {
30
-				$this->value            = ( isset( $this->current ) ) ? $this->current : '';
31
-				$this->field['current'] = $this->value;
29
+            if ( false === filter_var( $this->value, FILTER_VALIDATE_URL ) ) {
30
+                $this->value            = ( isset( $this->current ) ) ? $this->current : '';
31
+                $this->field['current'] = $this->value;
32 32
 
33
-				$this->error = $this->field;
34
-			} else {
35
-				$this->value = esc_url_raw( $this->value );
36
-			}
37
-		}
38
-	}
33
+                $this->error = $this->field;
34
+            } else {
35
+                $this->value = esc_url_raw( $this->value );
36
+            }
37
+        }
38
+    }
39 39
 }
Please login to merge, or discard this patch.
redux-core/inc/validation/not_empty/class-redux-validation-not-empty.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -12,23 +12,23 @@
 block discarded – undo
12 12
 
13 13
 if ( ! class_exists( 'Redux_Validation_Not_Empty', false ) ) {
14 14
 
15
-	/**
16
-	 * Class Redux_Validation_Not_Empty
17
-	 */
18
-	class Redux_Validation_Not_Empty extends Redux_Validate {
15
+    /**
16
+     * Class Redux_Validation_Not_Empty
17
+     */
18
+    class Redux_Validation_Not_Empty extends Redux_Validate {
19 19
 
20
-		/**
21
-		 * Field Validation Function.
22
-		 * Takes the vars and outputs the HTML for the field in the settings
23
-		 *
24
-		 * @since ReduxFramework 1.0.0
25
-		 */
26
-		public function validate() {
27
-			$this->field['msg'] = $this->field['msg'] ?? esc_html__( 'This field cannot be empty. Please provide a value.', 'redux-framework' );
20
+        /**
21
+         * Field Validation Function.
22
+         * Takes the vars and outputs the HTML for the field in the settings
23
+         *
24
+         * @since ReduxFramework 1.0.0
25
+         */
26
+        public function validate() {
27
+            $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'This field cannot be empty. Please provide a value.', 'redux-framework' );
28 28
 
29
-			if ( ! isset( $this->value ) || '' === $this->value || 0 === strlen( $this->value ) ) {
30
-				$this->error = $this->field;
31
-			}
32
-		}
33
-	}
29
+            if ( ! isset( $this->value ) || '' === $this->value || 0 === strlen( $this->value ) ) {
30
+                $this->error = $this->field;
31
+            }
32
+        }
33
+    }
34 34
 }
Please login to merge, or discard this patch.