Done !
Server IP : 162.0.217.223 / Your IP : 216.73.216.168 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/www/wp-content/plugins/seo-by-rank-math/includes/rest/ |
Upload File : |
<?php /** * The Global functionality of the plugin. * * Defines the functionality loaded on admin. * * @since 1.0.15 * @package RankMath * @subpackage RankMath\Rest * @author Rank Math <support@rankmath.com> */ namespace RankMath\Rest; use RankMath\CMB2; defined( 'ABSPATH' ) || exit; /** * Admin class. */ class Sanitize { /** * Main instance * * Ensure only one instance is loaded or can be loaded. * * @return Sanitize */ public static function get() { static $instance; if ( is_null( $instance ) && ! ( $instance instanceof Sanitize ) ) { $instance = new Sanitize(); } return $instance; } /** * Sanitize value * * @param string $field_id Field id to sanitize. * @param mixed $value Field value. * * @return mixed Sanitized value. */ public function sanitize( $field_id, $value ) { $sanitized_value = ''; switch ( $field_id ) { case 'rank_math_title': case 'rank_math_description': case 'rank_math_snippet_name': case 'rank_math_snippet_desc': case 'rank_math_facebook_title': case 'rank_math_facebook_description': case 'rank_math_twitter_title': case 'rank_math_twitter_description': $sanitized_value = wp_filter_nohtml_kses( $value ); break; case 'rank_math_snippet_recipe_ingredients': case 'rank_math_snippet_recipe_instructions': case 'rank_math_snippet_recipe_single_instructions': $sanitized_value = $this->sanitize_textarea( $field_id, $value ); break; case 'rank_math_canonical_url': $sanitized_value = esc_url_raw( $value ); break; default: $sanitized_value = is_array( $value ) ? $this->loop_sanitize( $value ) : CMB2::sanitize_textfield( $value ); } return $sanitized_value; } /** * Sanitize Textarea field * * @param string $field_id Field id to sanitize. * @param mixed $value Field value. * * @return mixed Sanitized value. */ public function sanitize_textarea( $field_id, $value ) { return is_array( $value ) ? $this->loop_sanitize( $value, 'sanitize_textarea' ) : sanitize_textarea_field( $value ); } /** * Sanitize array * * @param array $array Field value. * @param array $method Sanitize Method. * * @return mixed Sanitized value. */ public function loop_sanitize( $array, $method = 'sanitize' ) { $sanitized_value = []; foreach ( $array as $key => $value ) { $sanitized_value[ CMB2::sanitize_textfield( $key ) ] = is_array( $value ) ? $this->loop_sanitize( $value, $method ) : $this->$method( $key, $value ); } return $sanitized_value; } }