Make WordPress Core

Changeset 36185


Ignore:
Timestamp:
01/06/2016 05:22:08 PM (9 years ago)
Author:
jorbin
Message:

Theme: Escape error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r35738 r36185  
    241241            $this->headers['Name'] = $this->stylesheet;
    242242            if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
    243                 $this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), $this->stylesheet ) );
     243                $this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
    244244            else
    245245                $this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
     
    288288            } else {
    289289                // Parent theme is missing.
    290                 $this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), $this->template ) );
     290                $this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
    291291                $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
    292292                $this->parent = new WP_Theme( $this->template, $this->theme_root, $this );
     
    300300            if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
    301301                $_child->parent = null;
    302                 $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
     302                $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
    303303                $_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
    304304                // The two themes actually reference each other with the Template header.
    305305                if ( $_child->stylesheet == $this->template ) {
    306                     $this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $this->template ) );
     306                    $this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
    307307                    $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
    308308                }
Note: See TracChangeset for help on using the changeset viewer.