Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
691f31ccf6 | ||
|
|
cf7dbdbdca | ||
|
|
02a98204d7 | ||
|
|
e68cfb41cd | ||
|
|
452efae4e3 |
@@ -45,6 +45,46 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.18'
|
||||
);
|
||||
?>
|
||||
<?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/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.18' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed one security issue.' ),
|
||||
'4.8.17'
|
||||
);
|
||||
?>
|
||||
<?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/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.17' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
|
||||
@@ -1248,8 +1248,8 @@ function upgrade_280() {
|
||||
$start = 0;
|
||||
while( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) {
|
||||
foreach ( $rows as $row ) {
|
||||
$value = $row->option_value;
|
||||
if ( !@unserialize( $value ) )
|
||||
$value = maybe_unserialize( $row->option_value );
|
||||
if ( $value === $row->option_value )
|
||||
$value = stripslashes( $value );
|
||||
if ( $value !== $row->option_value ) {
|
||||
update_option( $row->option_name, $value );
|
||||
|
||||
@@ -1294,9 +1294,12 @@ class PHPMailer
|
||||
|
||||
// Sign with DKIM if enabled
|
||||
if (!empty($this->DKIM_domain)
|
||||
&& !empty($this->DKIM_selector)
|
||||
&& (!empty($this->DKIM_private_string)
|
||||
|| (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
|
||||
and !empty($this->DKIM_selector)
|
||||
and (!empty($this->DKIM_private_string)
|
||||
or (!empty($this->DKIM_private)
|
||||
and self::isPermittedPath($this->DKIM_private)
|
||||
and file_exists($this->DKIM_private)
|
||||
)
|
||||
)
|
||||
) {
|
||||
$header_dkim = $this->DKIM_Add(
|
||||
@@ -1461,6 +1464,39 @@ class PHPMailer
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a file path is of a permitted type.
|
||||
* Used to reject URLs and phar files from functions that access local file paths,
|
||||
* such as addAttachment.
|
||||
* @param string $path A relative or absolute path to a file.
|
||||
* @return bool
|
||||
*/
|
||||
protected static function isPermittedPath($path)
|
||||
{
|
||||
//Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
|
||||
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a file path is safe, accessible, and readable.
|
||||
*
|
||||
* @param string $path A relative or absolute path to a file
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function fileIsAccessible($path)
|
||||
{
|
||||
if (!self::isPermittedPath($path)) {
|
||||
return false;
|
||||
}
|
||||
$readable = file_exists($path);
|
||||
//If not a UNC path (expected to start with \\), check read permission, see #2069
|
||||
if (strpos($path, '\\\\') !== 0) {
|
||||
$readable = $readable && is_readable($path);
|
||||
}
|
||||
return $readable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mail using the PHP mail() function.
|
||||
* @param string $header The message headers
|
||||
@@ -1784,7 +1820,7 @@ class PHPMailer
|
||||
// There is no English translation file
|
||||
if ($langcode != 'en') {
|
||||
// Make sure language file path is readable
|
||||
if (!is_readable($lang_file)) {
|
||||
if (!self::fileIsAccessible($lang_file)) {
|
||||
$foundlang = false;
|
||||
} else {
|
||||
// Overwrite language-specific strings.
|
||||
@@ -2495,6 +2531,8 @@ class PHPMailer
|
||||
* Add an attachment from a path on the filesystem.
|
||||
* Never use a user-supplied path to a file!
|
||||
* Returns false if the file could not be found or read.
|
||||
* Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client.
|
||||
* If you need to do that, fetch the resource yourself and pass it in via a local file or string.
|
||||
* @param string $path Path to the attachment.
|
||||
* @param string $name Overrides the attachment name.
|
||||
* @param string $encoding File encoding (see $Encoding).
|
||||
@@ -2506,7 +2544,7 @@ class PHPMailer
|
||||
public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
|
||||
{
|
||||
try {
|
||||
if (!@is_file($path)) {
|
||||
if (!self::fileIsAccessible($path)) {
|
||||
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
|
||||
}
|
||||
|
||||
@@ -2687,7 +2725,7 @@ class PHPMailer
|
||||
protected function encodeFile($path, $encoding = 'base64')
|
||||
{
|
||||
try {
|
||||
if (!is_readable($path)) {
|
||||
if (!self::fileIsAccessible($path)) {
|
||||
throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
|
||||
}
|
||||
$magic_quotes = get_magic_quotes_runtime();
|
||||
@@ -3031,7 +3069,7 @@ class PHPMailer
|
||||
*/
|
||||
public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
|
||||
{
|
||||
if (!@is_file($path)) {
|
||||
if (!self::fileIsAccessible($path)) {
|
||||
$this->setError($this->lang('file_access') . $path);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -717,7 +717,7 @@ class WP_Meta_Query {
|
||||
$clause_compare = strtoupper( $clause['compare'] );
|
||||
$sibling_compare = strtoupper( $sibling['compare'] );
|
||||
if ( in_array( $clause_compare, $compatible_compares ) && in_array( $sibling_compare, $compatible_compares ) ) {
|
||||
$alias = $sibling['alias'];
|
||||
$alias = preg_replace( '/\W/', '_', $sibling['alias'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ class WP_Tax_Query {
|
||||
|
||||
// The sibling must both have compatible operator to share its alias.
|
||||
if ( in_array( strtoupper( $sibling['operator'] ), $compatible_operators ) ) {
|
||||
$alias = $sibling['alias'];
|
||||
$alias = preg_replace( '/\W/', '_', $sibling['alias'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -573,7 +573,11 @@ class WP_Tax_Query {
|
||||
return;
|
||||
}
|
||||
|
||||
$query['terms'] = array_unique( (array) $query['terms'] );
|
||||
if ( 'slug' === $query['field'] || 'name' === $query['field'] ) {
|
||||
$query['terms'] = array_unique( (array) $query['terms'] );
|
||||
} else {
|
||||
$query['terms'] = wp_parse_id_list( $query['terms'] );
|
||||
}
|
||||
|
||||
if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) {
|
||||
$this->transform_query( $query, 'term_id' );
|
||||
|
||||
@@ -1070,12 +1070,14 @@ function wp_check_invalid_utf8( $string, $strip = false ) {
|
||||
* Encode the Unicode values to be used in the URI.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 5.8.3 Added the `encode_ascii_characters` parameter.
|
||||
*
|
||||
* @param string $utf8_string
|
||||
* @param int $length Max length of the string
|
||||
* @param string $utf8_string String to encode.
|
||||
* @param int $length Max length of the string
|
||||
* @param bool $encode_ascii_characters Whether to encode ascii characters such as < " '
|
||||
* @return string String with Unicode encoded for URI.
|
||||
*/
|
||||
function utf8_uri_encode( $utf8_string, $length = 0 ) {
|
||||
function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters = false ) {
|
||||
$unicode = '';
|
||||
$values = array();
|
||||
$num_octets = 1;
|
||||
@@ -1090,11 +1092,14 @@ function utf8_uri_encode( $utf8_string, $length = 0 ) {
|
||||
$value = ord( $utf8_string[ $i ] );
|
||||
|
||||
if ( $value < 128 ) {
|
||||
if ( $length && ( $unicode_length >= $length ) ) {
|
||||
$char = chr( $value );
|
||||
$encoded_char = $encode_ascii_characters ? rawurlencode( $char ) : $char;
|
||||
$encoded_char_length = strlen( $encoded_char );
|
||||
if ( $length && ( $unicode_length + $encoded_char_length ) > $length ) {
|
||||
break;
|
||||
}
|
||||
$unicode .= chr( $value );
|
||||
$unicode_length++;
|
||||
$unicode .= $encoded_char;
|
||||
$unicode_length += $encoded_char_length;
|
||||
} else {
|
||||
if ( count( $values ) == 0 ) {
|
||||
if ( $value < 224 ) {
|
||||
|
||||
@@ -3822,7 +3822,7 @@ function _truncate_post_slug( $slug, $length = 200 ) {
|
||||
if ( $decoded_slug === $slug )
|
||||
$slug = substr( $slug, 0, $length );
|
||||
else
|
||||
$slug = utf8_uri_encode( $decoded_slug, $length );
|
||||
$slug = utf8_uri_encode( $decoded_slug, $length, true );
|
||||
}
|
||||
|
||||
return rtrim( $slug, '-' );
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8.16';
|
||||
$wp_version = '4.8.18';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user