| Server IP : 213.186.33.4 / Your IP : 216.73.216.146 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www/wp-content/plugins/seo-by-rank-math/includes/admin/database/ |
Upload File : |
<?php
/**
* The escape functions.
*
* @since 1.0.0
* @package RankMath
* @subpackage RankMath\Admin\Database
* @author RankMath <support@rankmath.com>
*/
namespace RankMath\Admin\Database;
/**
* Escape class.
*/
trait Escape {
/**
* Escape array values for sql
*
* @param array $arr Array to escape.
*
* @return array
*/
public function esc_array( $arr ) {
return array_map( [ $this, 'esc_value' ], $arr );
}
/**
* Escape value for sql
*
* @param mixed $value Value to escape.
*
* @return mixed
*/
public function esc_value( $value ) {
global $wpdb;
if ( is_int( $value ) ) {
return $wpdb->prepare( '%d', $value );
}
if ( is_float( $value ) ) {
return $wpdb->prepare( '%f', $value );
}
return 'NULL' === $value ? $value : $wpdb->prepare( '%s', $value );
}
/**
* Escape value for like statement
*
* @codeCoverageIgnore
*
* @param string $value Value for like statement.
* @param string $start (Optional) The start of like query.
* @param string $end (Optional) The end of like query.
*
* @return string
*/
public function esc_like( $value, $start = '%', $end = '%' ) {
global $wpdb;
return $start . $wpdb->esc_like( $value ) . $end;
}
}