WordPress 7.1.2
Pristine upstream, unpacked from the official wordpress.org tarball. https://wordpress.org/wordpress-7.1.2.tar.gz sha1 761b8101538f0631a0bfc4fba7bc4abeea92f81c (published by wordpress.org) sha256 c0c666689d66b870d8825500bb8e402ed04de52602c61a6f516c6236b8c9ac67 This branch carries nothing but upstream releases, one commit each, and is never edited.
This commit is contained in:
parent
1f173de885
commit
7241275389
3 changed files with 93 additions and 7 deletions
|
|
@ -61,6 +61,26 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||||
<div class="about__section changelog has-subtle-background-color">
|
<div class="about__section changelog has-subtle-background-color">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>
|
<h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>
|
||||||
|
<p>
|
||||||
|
<?php
|
||||||
|
printf(
|
||||||
|
/* translators: %s: WordPress version. */
|
||||||
|
__( '<strong>Version %s</strong> addressed one security issue.' ),
|
||||||
|
'7.1.2'
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
printf(
|
||||||
|
/* translators: %s: HelpHub URL. */
|
||||||
|
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: WordPress version. */
|
||||||
|
esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
|
||||||
|
sanitize_title( '7.1.2' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
printf(
|
printf(
|
||||||
|
|
|
||||||
|
|
@ -490,7 +490,7 @@ function get_page_template() {
|
||||||
}
|
}
|
||||||
if ( $pagename ) {
|
if ( $pagename ) {
|
||||||
$pagename_decoded = urldecode( $pagename );
|
$pagename_decoded = urldecode( $pagename );
|
||||||
if ( $pagename_decoded !== $pagename ) {
|
if ( $pagename_decoded !== $pagename && 0 === validate_file( $pagename_decoded ) ) {
|
||||||
$templates[] = "page-{$pagename_decoded}.php";
|
$templates[] = "page-{$pagename_decoded}.php";
|
||||||
}
|
}
|
||||||
$templates[] = "page-{$pagename}.php";
|
$templates[] = "page-{$pagename}.php";
|
||||||
|
|
@ -698,6 +698,67 @@ function wp_set_template_globals() {
|
||||||
$wp_template_path = get_template_directory();
|
$wp_template_path = get_template_directory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether a template found by locate_template() may be loaded.
|
||||||
|
*
|
||||||
|
* @since 7.1.2
|
||||||
|
* @access private
|
||||||
|
*
|
||||||
|
* @global string $wp_stylesheet_path Path to current theme's stylesheet directory.
|
||||||
|
* @global string $wp_template_path Path to current theme's template directory.
|
||||||
|
*
|
||||||
|
* @param string $path Path to an existing template file.
|
||||||
|
* @return bool Whether the template may be loaded.
|
||||||
|
*/
|
||||||
|
function _wp_is_template_path_allowed( $path ) {
|
||||||
|
global $wp_stylesheet_path, $wp_template_path;
|
||||||
|
|
||||||
|
// A file path that exists and does not contain `..` is allowed.
|
||||||
|
if ( 0 === preg_match( '#(?:^|/)\.\.[. ]*(?:/|$)#', wp_normalize_path( $path ) ) ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve the true location of the requested file for later comparison.
|
||||||
|
$real_path = realpath( $path );
|
||||||
|
|
||||||
|
if ( false === $real_path ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$real_path = trailingslashit( wp_normalize_path( $real_path ) );
|
||||||
|
|
||||||
|
$directories = array(
|
||||||
|
$wp_stylesheet_path,
|
||||||
|
$wp_template_path,
|
||||||
|
ABSPATH . WPINC . '/theme-compat',
|
||||||
|
);
|
||||||
|
|
||||||
|
// If a theme is in a subdirectory, accept templates from its direct parent directory.
|
||||||
|
if ( str_contains( get_stylesheet(), '/' ) ) {
|
||||||
|
$directories[] = dirname( $wp_stylesheet_path );
|
||||||
|
}
|
||||||
|
|
||||||
|
// If a parent theme is in a subdirectory, accept templates from its direct parent directory.
|
||||||
|
if ( str_contains( get_template(), '/' ) ) {
|
||||||
|
$directories[] = dirname( $wp_template_path );
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( $directories as $directory ) {
|
||||||
|
$real_directory = realpath( $directory );
|
||||||
|
|
||||||
|
if ( false === $real_directory ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The true location of the requested file must be inside one of the allowed directories.
|
||||||
|
if ( str_starts_with( $real_path, trailingslashit( wp_normalize_path( $real_directory ) ) ) ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the name of the highest priority template file that exists.
|
* Retrieves the name of the highest priority template file that exists.
|
||||||
*
|
*
|
||||||
|
|
@ -707,6 +768,7 @@ function wp_set_template_globals() {
|
||||||
*
|
*
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
* @since 5.5.0 The `$args` parameter was added.
|
* @since 5.5.0 The `$args` parameter was added.
|
||||||
|
* @since 7.1.2 A template name containing `..` is only located if it resolves inside the theme.
|
||||||
*
|
*
|
||||||
* @global string $wp_stylesheet_path Path to current theme's stylesheet directory.
|
* @global string $wp_stylesheet_path Path to current theme's stylesheet directory.
|
||||||
* @global string $wp_template_path Path to current theme's template directory.
|
* @global string $wp_template_path Path to current theme's template directory.
|
||||||
|
|
@ -734,13 +796,17 @@ function locate_template( $template_names, $load = false, $load_once = true, $ar
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( file_exists( $wp_stylesheet_path . '/' . $template_name ) ) {
|
if ( file_exists( $wp_stylesheet_path . '/' . $template_name ) ) {
|
||||||
$located = $wp_stylesheet_path . '/' . $template_name;
|
$candidate = $wp_stylesheet_path . '/' . $template_name;
|
||||||
break;
|
|
||||||
} elseif ( $is_child_theme && file_exists( $wp_template_path . '/' . $template_name ) ) {
|
} elseif ( $is_child_theme && file_exists( $wp_template_path . '/' . $template_name ) ) {
|
||||||
$located = $wp_template_path . '/' . $template_name;
|
$candidate = $wp_template_path . '/' . $template_name;
|
||||||
break;
|
|
||||||
} elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
|
} elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
|
||||||
$located = ABSPATH . WPINC . '/theme-compat/' . $template_name;
|
$candidate = ABSPATH . WPINC . '/theme-compat/' . $template_name;
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _wp_is_template_path_allowed( $candidate ) ) {
|
||||||
|
$located = $candidate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '7.1.1';
|
$wp_version = '7.1.2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue