| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Display basic CSS. |
| 10 |
* |
| 11 |
* @package Charitable |
| 12 |
* @author WP Charitable LLC |
| 13 |
* @since 1.8.0 |
| 14 |
* @version 1.8.8.6 |
| 15 |
*/ |
| 16 |
|
| 17 |
if ( ! function_exists( 'wp_unslash' ) ) { |
| 18 |
/** |
| 19 |
* Unslash a value. |
| 20 |
* |
| 21 |
* @param mixed $value The value to unslash. |
| 22 |
* @return mixed The unslashed value. |
| 23 |
*/ |
| 24 |
function wp_unslash( $value ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- This is a WordPress core function fallback for older WordPress versions. |
| 25 |
return is_array( $value ) ? array_map( 'wp_unslash', $value ) : stripslashes( $value ); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
if ( ! function_exists( 'sanitize_text_field' ) ) { |
| 30 |
/** |
| 31 |
* Sanitize a text field. |
| 32 |
* |
| 33 |
* @param string $str The string to sanitize. |
| 34 |
* @return string The sanitized string. |
| 35 |
*/ |
| 36 |
function sanitize_text_field( $str ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- This is a WordPress core function fallback for older WordPress versions. |
| 37 |
$filtered = preg_replace( '/[\r\n\t\0\x0B]/', '', $str ); |
| 38 |
$filtered = filter_var( $filtered, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH ); |
| 39 |
return trim( $filtered ); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
header( 'Content-type: text/css; charset: UTF-8' ); |
| 44 |
|
| 45 |
$primary = isset( $_GET['p'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', sanitize_text_field( wp_unslash( $_GET['p'] ) ) ), 0, 6 ) : '#3418d2'; // phpcs:ignore |
| 46 |
$secondary = isset( $_GET['s'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', sanitize_text_field( wp_unslash( $_GET['s'] ) ) ), 0, 6 ) : '#005eff'; // phpcs:ignore |
| 47 |
$tertiary = isset( $_GET['t'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', sanitize_text_field( wp_unslash( $_GET['t'] ) ) ), 0, 6 ) : '#00a1ff'; // phpcs:ignore |
| 48 |
$button = isset( $_GET['b'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', sanitize_text_field( wp_unslash( $_GET['b'] ) ) ), 0, 6 ) : '#ec5f25'; // phpcs:ignore |
| 49 |
|
| 50 |
$wrapper = '.charitable-preview #charitable-design-wrap .charitable-campaign-preview'; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Variable is defined but not used in this file. |
| 51 |
|