Escape frontend colors

This commit is contained in:
Brian Miyaji
2015-03-11 18:25:27 +11:00
parent dcfda1c2f1
commit f8b5cb4540
2 changed files with 3 additions and 1 deletions

View File

@@ -320,6 +320,7 @@ class SP_Settings_General extends SP_Settings_Page {
<?php <?php
// Get settings // Get settings
$colors = array_map( 'esc_attr', (array) get_option( 'themeboy', array() ) ); $colors = array_map( 'esc_attr', (array) get_option( 'themeboy', array() ) );
if ( empty( $colors ) ) $colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) );
// Defaults // Defaults
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e'; if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e';

View File

@@ -148,7 +148,8 @@ class SP_Frontend_Scripts {
$offset = ( 'twentyfourteen' == $template ? 48 : 0 ); $offset = ( 'twentyfourteen' == $template ? 48 : 0 );
} }
$colors = (array) get_option( 'themeboy', array() ); $colors = array_map( 'esc_attr', (array) get_option( 'themeboy', array() ) );
if ( empty( $colors ) ) $colors = array_map( 'esc_attr', (array) get_option( 'sportspress_frontend_css_colors', array() ) );
// Defaults // Defaults
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e'; if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e';