From ca8d6fb60f29d899cbc1b0e668b6966c58599384 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 27 Apr 2015 05:09:24 +0000 Subject: [PATCH] Escape the $s global. fixes #32142. git-svn-id: https://develop.svn.wordpress.org/trunk@32298 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/template.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/template.php b/src/wp-includes/template.php index cfe9bb06aa..e43ba321e5 100644 --- a/src/wp-includes/template.php +++ b/src/wp-includes/template.php @@ -494,12 +494,18 @@ function locate_template($template_names, $load = false, $require_once = true ) function load_template( $_template_file, $require_once = true ) { global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; - if ( is_array( $wp_query->query_vars ) ) + if ( is_array( $wp_query->query_vars ) ) { extract( $wp_query->query_vars, EXTR_SKIP ); + } - if ( $require_once ) + if ( isset( $s ) ) { + $s = esc_attr( $s ); + } + + if ( $require_once ) { require_once( $_template_file ); - else + } else { require( $_template_file ); + } }