C:\xampp\htdocs\landing\wp-content\plugins\penci-smart-lists\lib\meta-box\inc\sanitizer.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
 * Sanitize field value before saving.
 *
 * @package Meta Box
 */

/**
 * Sanitize class.
 */
class RWMB_Sanitizer {

    
/**
     * Built-in callbacks for some specific types.
     *
     * @var array
     */
    
protected $callbacks = array(
        
'email'      => 'sanitize_email',
        
'file_input' => 'esc_url_raw',
        
'oembed'     => 'esc_url_raw',
        
'url'        => 'esc_url_raw',
    );

    
/**
     * Register hook to sanitize field value.
     */
    
public function init() {
        
// Built-in callback.
        
foreach ( $this->callbacks as $type => $callback ) {
            
add_filter"rwmb_{$type}_sanitize"$callback );
        }

        
// Custom callback.
        
$types array_diffget_class_methods__CLASS__ ), array( 'init' ) );
        foreach ( 
$types as $type ) {
            
add_filter"rwmb_{$type}_sanitize", array( $this$type ) );
        }
    }

    
/**
     * Set the value of checkbox to 1 or 0 instead of 'checked' and empty string.
     * This prevents using default value once the checkbox has been unchecked.
     *
     * @link https://github.com/rilwis/meta-box/issues/6
     * @param string $value Checkbox value.
     * @return int
     */
    
public function checkbox$value ) {
        return (int) ! empty( 
$value );
    }
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586