<?php 
if ( !defined('ABSPATH')) exit;
/**
 * The public-facing functionality of the plugin.
 * @package    Lazy load videos and sticky control
 * Requires at least: 5.2
 * Requires PHP:      7.2
 * Author:            Aishan Shrestha
 * Author URI:        https://aishan-shrestha.com.np
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       lazy-load-videos-and-sticky-control
 */

ob_start();
header("Content-type: text/css");

// Get the custom CSS from the options
$custom_css = get_option('_llvasc_general_section');
$custom_css = isset($custom_css['_llvasc_custom_css']) ? $custom_css['_llvasc_custom_css'] : '';

// Sanitize the CSS content
$custom_css = wp_kses( $custom_css, array( '\'', '\"' ) );  // This is a minimal filter and not ideal for CSS

// Replace HTML entities that are potentially harmful for CSS output (e.g., &gt; to >)
$custom_css = str_replace( '&gt;', '>', $custom_css );

// Escape the CSS content for output in the HTML document
// Use esc_html() to escape the custom CSS, making sure to handle any potentially dangerous characters
// Output the sanitized and escaped custom CSS
echo esc_html( $custom_css );
