class-redux-validation-css.php (999B)
1 <?php 2 /** 3 * CSS validation 4 * 5 * @package Redux Framework 6 * @subpackage Validation 7 * @author Kevin Provance (kprovance) & Dovy Paukstys 8 * @version 4.0.0 9 */ 10 11 defined( 'ABSPATH' ) || exit; 12 13 if ( ! class_exists( 'Redux_Validation_Css', false ) ) { 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'] = isset( $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 }