File "class-redux-validation-css.php"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/kapee-extensions/inc/admin/redux-core/inc/validation/css/class-redux-validation-css.php
File size: 999 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * CSS validation
 *
 * @package     Redux Framework
 * @subpackage  Validation
 * @author      Kevin Provance (kprovance) & Dovy Paukstys
 * @version     4.0.0
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'Redux_Validation_Css', false ) ) {

	/**
	 * Class Redux_Validation_Css
	 */
	class Redux_Validation_Css extends Redux_Validate {

		/**
		 * Field Validation Function.
		 * Takes the vars and validates them
		 *
		 * @since ReduxFramework 3.0.0
		 */
		public function validate() {
			$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' );

			$data = $this->value;

			$data = wp_filter_nohtml_kses( $data );
			$data = str_replace( '&gt;', '>', $data );
			$data = stripslashes( $data );

			if ( $data !== $this->value ) {
				$this->field['current'] = $data;
				$this->warning          = $this->field;
			}

			$this->value = $data;
		}
	}
}