403Webshell
Server IP : 89.108.64.180  /  Your IP : 216.73.217.95
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-root ( 1010)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/aravanatula.ru/wp-content/plugins/calluna-core/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/aravanatula.ru/wp-content/plugins/calluna-core/inc/sanitize-data.php
<?php
/**
 * Sanitize inputted data
 *
 */

class Calluna_Core_Sanitize_Data {

    /**
     * Parses data
     *
     */
    public function calluna_core_parse_data( $data, $type ) {
        $type = str_replace( '-', '_', $type );
        if ( method_exists( $this, $type ) ) {
            return $this->$type( $data );
        }
    }

    /**
     * Pixels
     *
     */
    private function px( $data ) {

        if ( 'none' == $data ) {
            return '0';
        } else {
            return floatval( $data ) . 'px';
        }

    }

    /**
     * Font Size
     *
     */
    private function font_size( $data ) {

        if ( strpos( $data, 'px' ) || strpos( $data, 'em' ) || strpos( $data, 'rem') ) {
            $data = $data;
        } else {
            $data = intval( $data ) .'px';
        }

        if ( $data != '0px' && $data != '0em' && $data != '0rem' ) {
            return $data;
        }

    }

    /**
     * Font Weight
     *
     */
    private function font_weight( $data ) {

        if ( 'normal' == $data ) {
            $data = '400';
        } elseif ( 'semibold' == $data ) {
            $data = '600';
        } elseif ( 'bold' == $data ) {
            $data = '700';
        } elseif ( 'bolder' == $data ) {
            $data = '900';
        }

        return $data;
        
    }

    /**
     * Hex Color
     *
     */
    private function hex_color( $data ) {

        if ( 'none' == $data ) {
            return 'transparent';
        } elseif ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $data ) ) {
            return $data;
        } else {
            return null;
        }

    }

    /**
     * Border Radius
     *
     */
    private function border_radius( $data ) {

        if ( 'none' == $data ) {
            return '0';
        } elseif ( strpos( $data, 'px' ) ) {
            return $data;
        } elseif ( strpos( $data, '%' ) ) {
            if ( '50%' == $data ) {
                return $data;
            } else {
                return str_replace( '%', 'px', $data );
            }
        } else {
            return intval( $data ) .'px';
        }

    }

    /**
     * Pixel or Percent
     */
    private function px_pct( $data ) {

        if ( 'none' == $data || '0px' == $data ) {
            return '0';
        } elseif ( strpos( $data, '%' ) ) {
            return $data;
        } elseif ( $data = floatval( $data ) ) {
            return $data .'px';
        }

    }

    /**
     * Opacity
     */
    private function opacity( $data ) {

        if ( ! is_numeric( $data ) ) {
            return;
        } elseif ( '1' > $data ) {
            return $data;
        } else {
            return;
        }

    }

    /**
     * Embed URL
     */
    private function embed_url( $data ) {

        // First sanatize the URL
        $url = esc_url( $data );

        // Sanitize vimeo
        if ( $url && false !== strpos( $url, 'vimeo' ) ) {

            // Return if good
            if ( strpos( $url, 'player.vimeo' ) ) {
                return $url;
            }
            
            // Get the ID
            $video_id = str_replace( 'http://vimeo.com/', '', $url );
            if ( ! is_numeric( $video_id ) ) {
                $video_id = str_replace( 'https://vimeo.com/', '', $url );
            } elseif ( ! is_numeric( $video_id ) ) {
                $video_id = str_replace( 'http://www.vimeo.com/', '', $url );
            } elseif ( ! is_numeric( $video_id ) ) {
                $video_id = str_replace( 'https://www.vimeo.com/', '', $url );
            }

            // Return embed URL
            if ( is_numeric( $video_id ) ) {
                return esc_url( 'player.vimeo.com/video/'. $video_id );
            }

        }

        // Sanitize Youtube
        elseif ( $url && false !== strpos( $url, 'youtu' ) ) {

            // Return if already the embed url
            if ( strpos( $url, 'embed' ) ) {
                return $url;
            }

            // Convert url
            $url_string = parse_url( $url, PHP_URL_QUERY );
            parse_str( $url_string, $args );
            if ( ! empty ( $args['v'] ) ) {
                return esc_url( 'youtube.com/embed/' . $args['v'] );
            }

        }

    }


} // End Class

// Helper function runs the Calluna_Core_Sanitize_Data class
function calluna_core_sanitize_data( $data = '', $type = '' ) {
    if ( $data && $type ) {
        $class = new Calluna_Core_Sanitize_Data();
        return $class->calluna_core_parse_data( $data, $type );
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit