\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/softech.com.tr/wp-content/plugins/bdthemes-prime-slider-lite/includes/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/softech.com.tr/wp-content/plugins/bdthemes-prime-slider-lite/includes/utils.php |
<?php
namespace PrimeSlider;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Utils {
/**
* A list of safe tage for `get_valid_html_tag` method.
*/
const ALLOWED_HTML_WRAPPER_TAGS = [
'article',
'aside',
'div',
'footer',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'main',
'nav',
'p',
'section',
'span',
];
public static function get_client_ip() {
$server_ip_keys = [
'HTTP_CLIENT_IP',
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_X_CLUSTER_CLIENT_IP',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'REMOTE_ADDR',
];
foreach ( $server_ip_keys as $key ) {
if ( isset( $_SERVER[ $key ] ) && filter_var( $_SERVER[ $key ], FILTER_VALIDATE_IP ) ) {
return $_SERVER[ $key ];
}
}
// Fallback local ip.
return '127.0.0.1';
}
public static function get_site_domain() {
return str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
}
/**
* Validate an HTML tag against a safe allowed list.
* @param string $tag
* @return string
*/
public static function get_valid_html_tag( $tag ) {
return in_array( strtolower( $tag ), self::ALLOWED_HTML_WRAPPER_TAGS ) ? $tag : 'div';
}
/**
* Get placeholder image source.
* Retrieve the source of the placeholder image.
* @since 5.7.6
* @access public
* @static
* @return string The source of the default placeholder image used by Elementor.
*/
public static function get_placeholder_image_src() {
$placeholder_image = ELEMENTOR_ASSETS_URL . 'images/placeholder.png';
return $placeholder_image;
}
}