<body>
<h1 id="logo">
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
- <br /> Version 4.4.1
+ <br /> Version 4.4.2
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
</h2>
<div class="changelog point-releases">
- <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 1 ); ?></h3>
+ <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 2 ); ?></h3>
+ <p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
+ '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 17 ), '4.4.2', number_format_i18n( 17 ) ); ?>
+ <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.4.2' ); ?>
+ </p>
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 52 ), '4.4.1', number_format_i18n( 52 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.4.1' ); ?>
}
}
- foreach ( $meta as &$value ) {
- if ( is_string( $value ) ) {
- $value = wp_kses_post( $value );
+ foreach ( $meta['keywords'] as $key => $keyword ) {
+ if ( ! seems_utf8( $keyword ) ) {
+ $meta['keywords'][ $key ] = utf8_encode( $keyword );
}
}
+ $meta = wp_kses_post_deep( $meta );
+
/**
* Filter the array of meta data read from an image's exif data.
*
}
}
);
+ // Prevent submitting the form when pressing Enter on a focused field.
+ return false;
},
revert : function() {
-window.wp=window.wp||{};var inlineEditTax;!function(a,b){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5),b.what="#"+b.type+"-",a("#the-list").on("click","a.editinline",function(){return inlineEditTax.edit(this),!1}),c.keyup(function(a){return 27===a.which?inlineEditTax.revert():void 0}),a(".cancel",c).click(function(){return inlineEditTax.revert()}),a(".save",c).click(function(){return inlineEditTax.save(this)}),a("input, select",c).keydown(function(a){return 13===a.which?inlineEditTax.save(this):void 0}),a('#posts-filter input[type="submit"]').mousedown(function(){b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},edit:function(b){var c,d,e,f=this;return f.revert(),"object"==typeof b&&(b=f.getId(b)),c=a("#inline-edit").clone(!0),d=a("#inline_"+b),a("td",c).attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a(f.what+b).hide().after(c).after('<tr class="hidden"></tr>'),e=a(".name",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="name"]',c).val(e),e=a(".slug",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="slug"]',c).val(e),a(c).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",c).eq(0).focus(),!1},save:function(c){var d,e,f=a('input[name="taxonomy"]').val()||"";"object"==typeof c&&(c=this.getId(c)),a("table.widefat .spinner").addClass("is-active"),d={action:"inline-save-tax",tax_type:this.type,tax_ID:c,taxonomy:f},e=a("#edit-"+c).find(":input").serialize(),d=e+"&"+a.param(d),a.post(ajaxurl,d,function(d){var e,f,g,h=a("#edit-"+c+" .inline-edit-save .error");a("table.widefat .spinner").removeClass("is-active"),d?-1!==d.indexOf("<tr")?(a(inlineEditTax.what+c).siblings("tr.hidden").addBack().remove(),f=a(d).attr("id"),a("#edit-"+c).before(d).remove(),f?(g=f.replace(inlineEditTax.type+"-",""),e=a("#"+f)):(g=c,e=a(inlineEditTax.what+c)),a("#parent").find("option[value="+g+"]").text(e.find(".row-title").text()),e.hide().fadeIn(400,function(){e.find(".row-title").focus(),b.a11y.speak(inlineEditL10n.saved)})):(h.html(d).show(),b.a11y.speak(h.text())):(h.html(inlineEditL10n.error).show(),b.a11y.speak(inlineEditL10n.error))})},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");b&&(a("table.widefat .spinner").removeClass("is-active"),a("#"+b).siblings("tr.hidden").addBack().remove(),b=b.substr(b.lastIndexOf("-")+1),a(this.what+b).show().find(".row-title").focus())},getId:function(b){var c="TR"===b.tagName?b.id:a(b).parents("tr").attr("id"),d=c.split("-");return d[d.length-1]}},a(document).ready(function(){inlineEditTax.init()})}(jQuery,window.wp);
\ No newline at end of file
+window.wp=window.wp||{};var inlineEditTax;!function(a,b){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5),b.what="#"+b.type+"-",a("#the-list").on("click","a.editinline",function(){return inlineEditTax.edit(this),!1}),c.keyup(function(a){return 27===a.which?inlineEditTax.revert():void 0}),a(".cancel",c).click(function(){return inlineEditTax.revert()}),a(".save",c).click(function(){return inlineEditTax.save(this)}),a("input, select",c).keydown(function(a){return 13===a.which?inlineEditTax.save(this):void 0}),a('#posts-filter input[type="submit"]').mousedown(function(){b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},edit:function(b){var c,d,e,f=this;return f.revert(),"object"==typeof b&&(b=f.getId(b)),c=a("#inline-edit").clone(!0),d=a("#inline_"+b),a("td",c).attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a(f.what+b).hide().after(c).after('<tr class="hidden"></tr>'),e=a(".name",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="name"]',c).val(e),e=a(".slug",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="slug"]',c).val(e),a(c).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",c).eq(0).focus(),!1},save:function(c){var d,e,f=a('input[name="taxonomy"]').val()||"";return"object"==typeof c&&(c=this.getId(c)),a("table.widefat .spinner").addClass("is-active"),d={action:"inline-save-tax",tax_type:this.type,tax_ID:c,taxonomy:f},e=a("#edit-"+c).find(":input").serialize(),d=e+"&"+a.param(d),a.post(ajaxurl,d,function(d){var e,f,g,h=a("#edit-"+c+" .inline-edit-save .error");a("table.widefat .spinner").removeClass("is-active"),d?-1!==d.indexOf("<tr")?(a(inlineEditTax.what+c).siblings("tr.hidden").addBack().remove(),f=a(d).attr("id"),a("#edit-"+c).before(d).remove(),f?(g=f.replace(inlineEditTax.type+"-",""),e=a("#"+f)):(g=c,e=a(inlineEditTax.what+c)),a("#parent").find("option[value="+g+"]").text(e.find(".row-title").text()),e.hide().fadeIn(400,function(){e.find(".row-title").focus(),b.a11y.speak(inlineEditL10n.saved)})):(h.html(d).show(),b.a11y.speak(h.text())):(h.html(inlineEditL10n.error).show(),b.a11y.speak(inlineEditL10n.error))}),!1},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");b&&(a("table.widefat .spinner").removeClass("is-active"),a("#"+b).siblings("tr.hidden").addBack().remove(),b=b.substr(b.lastIndexOf("-")+1),a(this.what+b).show().find(".row-title").focus())},getId:function(b){var c="TR"===b.tagName?b.id:a(b).parents("tr").attr("id"),d=c.split("-");return d[d.length-1]}},a(document).ready(function(){inlineEditTax.init()})}(jQuery,window.wp);
\ No newline at end of file
if ( !empty( $registered_sidebar['class'] ) )
$wrap_class .= ' ' . $registered_sidebar['class'];
+ $is_inactive_widgets = 'wp_inactive_widgets' == $registered_sidebar['id'];
?>
<div class="<?php echo esc_attr( $wrap_class ); ?>">
<div class="widget-holder inactive">
<?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
+
+ <?php if ( $is_inactive_widgets ) { ?>
<div class="remove-inactive-widgets">
<form action="" method="post">
<p>
<?php wp_nonce_field( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); ?>
</form>
</div>
+ <?php } ?>
</div>
+ <?php if ( $is_inactive_widgets ) { ?>
<p class="description"><?php _e( 'This will clear all items from the inactive widgets list. You will not be able to restore any customizations.' ); ?></p>
+ <?php } ?>
</div>
<?php
'limits' => '',
);
+ /**
+ * SQL WHERE clause.
+ *
+ * Stored after the 'comments_clauses' filter is run on the compiled WHERE sub-clauses.
+ *
+ * @since 4.4.2
+ * @access protected
+ * @var string
+ */
+ protected $filtered_where_clause;
+
/**
* Date query container
*
foreach ( $post_fields as $field_name => $field_value ) {
// $field_value may be an array.
$esses = array_fill( 0, count( (array) $field_value ), '%s' );
- $this->sql_clauses['where']['post_fields'] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $field_value );
+ $this->sql_clauses['where'][ $field_name ] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $field_value );
}
}
$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
$groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
+ $this->filtered_where_clause = $where;
+
if ( $where ) {
$where = 'WHERE ' . $where;
}
0 => wp_list_pluck( $comments, 'comment_ID' ),
);
- $where_clauses = $this->sql_clauses['where'];
- unset(
- $where_clauses['parent'],
- $where_clauses['parent__in'],
- $where_clauses['parent__not_in']
- );
+ /*
+ * The WHERE clause for the descendant query is the same as for the top-level
+ * query, minus the `parent`, `parent__in`, and `parent__not_in` sub-clauses.
+ */
+ $_where = $this->filtered_where_clause;
+ $exclude_keys = array( 'parent', 'parent__in', 'parent__not_in' );
+ foreach ( $exclude_keys as $exclude_key ) {
+ if ( isset( $this->sql_clauses['where'][ $exclude_key ] ) ) {
+ $clause = $this->sql_clauses['where'][ $exclude_key ];
+
+ // Strip the clause as well as any adjacent ANDs.
+ $pattern = '|(?:AND)?\s*' . $clause . '\s*(?:AND)?|';
+ $_where_parts = preg_split( $pattern, $_where );
+
+ // Remove empties.
+ $_where_parts = array_filter( array_map( 'trim', $_where_parts ) );
+
+ // Reassemble with an AND.
+ $_where = implode( ' AND ', $_where_parts );
+ }
+ }
// Fetch an entire level of the descendant tree at a time.
$level = 0;
break;
}
- $where = 'WHERE ' . implode( ' AND ', $where_clauses ) . ' AND comment_parent IN (' . implode( ',', array_map( 'intval', $parent_ids ) ) . ')';
+ $where = 'WHERE ' . $_where . ' AND comment_parent IN (' . implode( ',', array_map( 'intval', $parent_ids ) ) . ')';
$comment_ids = $wpdb->get_col( "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} ORDER BY comment_date_gmt ASC, comment_ID ASC" );
$level++;
*/
public function get_return_url() {
$referer = wp_get_referer();
+ $excluded_referer_basenames = array( 'customize.php', 'wp-login.php' );
+
if ( $this->return_url ) {
$return_url = $this->return_url;
- } else if ( $referer && 'customize.php' !== basename( parse_url( $referer, PHP_URL_PATH ) ) ) {
+ } else if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
$return_url = $referer;
} else if ( $this->preview_url ) {
$return_url = $this->preview_url;
'order' => 'ASC',
'status' => 'approve',
'post_id' => $post->ID,
- 'hierarchical' => 'threaded',
'no_found_rows' => false,
'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.
);
+ if ( get_option('thread_comments') ) {
+ $comment_args['hierarchical'] = 'threaded';
+ } else {
+ $comment_args['hierarchical'] = false;
+ }
+
if ( $user_ID ) {
$comment_args['include_unapproved'] = array( $user_ID );
} elseif ( ! empty( $comment_author_email ) ) {
'count' => true,
'orderby' => false,
'post_id' => $post->ID,
- 'parent' => 0,
'status' => 'approve',
);
+ if ( $comment_args['hierarchical'] ) {
+ $top_level_args['parent'] = 0;
+ }
+
if ( isset( $comment_args['include_unapproved'] ) ) {
$top_level_args['include_unapproved'] = $comment_args['include_unapproved'];
}
$_comments = $comment_query->comments;
// Trees must be flattened before they're passed to the walker.
- $comments_flat = array();
- foreach ( $_comments as $_comment ) {
- $comments_flat[] = $_comment;
- $comment_children = $_comment->get_children( array(
- 'format' => 'flat',
- 'status' => $comment_args['status'],
- 'orderby' => $comment_args['orderby']
- ) );
-
- foreach ( $comment_children as $comment_child ) {
- $comments_flat[] = $comment_child;
+ if ( $comment_args['hierarchical'] ) {
+ $comments_flat = array();
+ foreach ( $_comments as $_comment ) {
+ $comments_flat[] = $_comment;
+ $comment_children = $_comment->get_children( array(
+ 'format' => 'flat',
+ 'status' => $comment_args['status'],
+ 'orderby' => $comment_args['orderby']
+ ) );
+
+ foreach ( $comment_children as $comment_child ) {
+ $comments_flat[] = $comment_child;
+ }
}
+ } else {
+ $comments_flat = $_comments;
}
/**
*/
$r = apply_filters( 'wp_list_comments_args', $r );
- /*
- * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
- * perform a separate comment query and allow Walker_Comment to paginate.
- */
- if ( is_singular() && ( $r['page'] || $r['per_page'] ) ) {
- $current_cpage = get_query_var( 'cpage' );
- if ( ! $current_cpage ) {
- $current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
- }
-
- $current_per_page = get_query_var( 'comments_per_page' );
- if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
- $comments = get_comments( array(
- 'post_id' => get_queried_object_id(),
- 'orderby' => 'comment_date_gmt',
- 'order' => 'ASC',
- 'status' => 'all',
- ) );
- }
- }
-
// Figure out what comments we'll be looping through ($_comments)
if ( null !== $comments ) {
$comments = (array) $comments;
$_comments = $comments;
}
} else {
- if ( empty($wp_query->comments) )
- return;
- if ( 'all' != $r['type'] ) {
- if ( empty($wp_query->comments_by_type) )
- $wp_query->comments_by_type = separate_comments($wp_query->comments);
- if ( empty($wp_query->comments_by_type[$r['type']]) )
- return;
- $_comments = $wp_query->comments_by_type[$r['type']];
- } else {
- $_comments = $wp_query->comments;
- }
+ /*
+ * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
+ * perform a separate comment query and allow Walker_Comment to paginate.
+ */
+ if ( $r['page'] || $r['per_page'] ) {
+ $current_cpage = get_query_var( 'cpage' );
+ if ( ! $current_cpage ) {
+ $current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
+ }
+
+ $current_per_page = get_query_var( 'comments_per_page' );
+ if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
+
+ $comments = get_comments( array(
+ 'post_id' => get_the_ID(),
+ 'orderby' => 'comment_date_gmt',
+ 'order' => 'ASC',
+ 'status' => 'all',
+ ) );
- // Pagination is already handled by `WP_Comment_Query`, so we tell Walker not to bother.
- if ( $wp_query->max_num_comment_pages ) {
- $default_comments_page = get_option( 'default_comments_page' );
- $cpage = get_query_var( 'cpage' );
- if ( 'newest' === $default_comments_page ) {
- $r['cpage'] = $cpage;
+ if ( 'all' != $r['type'] ) {
+ $comments_by_type = separate_comments( $comments );
+ if ( empty( $comments_by_type[ $r['type'] ] ) ) {
+ return;
+ }
+
+ $_comments = $comments_by_type[ $r['type'] ];
+ } else {
+ $_comments = $comments;
+ }
+ }
- // When first page shows oldest comments, post permalink is the same as the comment permalink.
- } elseif ( $cpage == 1 ) {
- $r['cpage'] = '';
+ // Otherwise, fall back on the comments from `$wp_query->comments`.
+ } else {
+ if ( empty($wp_query->comments) )
+ return;
+ if ( 'all' != $r['type'] ) {
+ if ( empty($wp_query->comments_by_type) )
+ $wp_query->comments_by_type = separate_comments($wp_query->comments);
+ if ( empty($wp_query->comments_by_type[$r['type']]) )
+ return;
+ $_comments = $wp_query->comments_by_type[$r['type']];
} else {
- $r['cpage'] = $cpage;
+ $_comments = $wp_query->comments;
}
- $r['page'] = 0;
- $r['per_page'] = 0;
+ if ( $wp_query->max_num_comment_pages ) {
+ $default_comments_page = get_option( 'default_comments_page' );
+ $cpage = get_query_var( 'cpage' );
+ if ( 'newest' === $default_comments_page ) {
+ $r['cpage'] = $cpage;
+
+ /*
+ * When first page shows oldest comments, post permalink is the same as
+ * the comment permalink.
+ */
+ } elseif ( $cpage == 1 ) {
+ $r['cpage'] = '';
+ } else {
+ $r['cpage'] = $cpage;
+ }
+
+ $r['page'] = 0;
+ $r['per_page'] = 0;
+ }
}
}
*
* @param string The emoji base URL.
*/
- 'baseUrl' => apply_filters( 'emoji_url', set_url_scheme( '//s.w.org/images/core/emoji/72x72/' ) ),
+ 'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/72x72/' ),
/**
* Filter the extension of the emoji files.
?>
<script type="text/javascript">
window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
- !function(a,b,c){function d(a){var c,d=b.createElement("canvas"),e=d.getContext&&d.getContext("2d");return e&&e.fillText?(e.textBaseline="top",e.font="600 32px Arial","flag"===a?(e.fillText(String.fromCharCode(55356,56806,55356,56826),0,0),d.toDataURL().length>3e3):"diversity"===a?(e.fillText(String.fromCharCode(55356,57221),0,0),c=e.getImageData(16,16,1,1).data.toString(),e.fillText(String.fromCharCode(55356,57221,55356,57343),0,0),c!==e.getImageData(16,16,1,1).data.toString()):("simple"===a?e.fillText(String.fromCharCode(55357,56835),0,0):e.fillText(String.fromCharCode(55356,57135),0,0),0!==e.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
+ !function(a,b,c){function d(a){var c,d=b.createElement("canvas"),e=d.getContext&&d.getContext("2d"),f=String.fromCharCode;return e&&e.fillText?(e.textBaseline="top",e.font="600 32px Arial","flag"===a?(e.fillText(f(55356,56806,55356,56826),0,0),d.toDataURL().length>3e3):"diversity"===a?(e.fillText(f(55356,57221),0,0),c=e.getImageData(16,16,1,1).data.toString(),e.fillText(f(55356,57221,55356,57343),0,0),c!==e.getImageData(16,16,1,1).data.toString()):("simple"===a?e.fillText(f(55357,56835),0,0):e.fillText(f(55356,57135),0,0),0!==e.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<?php
}
$text = wp_encode_emoji( $text );
/** This filter is documented in wp-includes/formatting.php */
- $cdn_url = apply_filters( 'emoji_url', set_url_scheme( '//s.w.org/images/core/emoji/72x72/' ) );
+ $cdn_url = apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/72x72/' );
/** This filter is documented in wp-includes/formatting.php */
$ext = apply_filters( 'emoji_ext', '.png' );
}
if ( $ip ) {
$parts = array_map( 'intval', explode( '.', $ip ) );
- if ( 127 === $parts[0] || 10 === $parts[0]
+ if ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0]
|| ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
|| ( 192 === $parts[0] && 168 === $parts[1] )
) {
function browserSupportsEmoji( type ) {
var canvas = document.createElement( 'canvas' ),
context = canvas.getContext && canvas.getContext( '2d' ),
+ stringFromCharCode = String.fromCharCode,
tone;
if ( ! context || ! context.fillText ) {
* The first two will encode to small images (1-2KB data URLs), the third will encode
* to a larger image (4-5KB data URL).
*/
- context.fillText( String.fromCharCode( 55356, 56806, 55356, 56826 ), 0, 0 );
+ context.fillText( stringFromCharCode( 55356, 56806, 55356, 56826 ), 0, 0 );
return canvas.toDataURL().length > 3000;
} else if ( 'diversity' === type ) {
/*
* emoji with no skin tone specified (in this case, Santa). It then adds a skin tone, and
* compares if the emoji rendering has changed.
*/
- context.fillText( String.fromCharCode( 55356, 57221 ), 0, 0 );
+ context.fillText( stringFromCharCode( 55356, 57221 ), 0, 0 );
tone = context.getImageData( 16, 16, 1, 1 ).data.toString();
- context.fillText( String.fromCharCode( 55356, 57221, 55356, 57343 ), 0, 0 );
+ context.fillText( stringFromCharCode( 55356, 57221, 55356, 57343 ), 0, 0 );
// Chrome has issues comparing arrays, so we compare it as a string, instead.
return tone !== context.getImageData( 16, 16, 1, 1 ).data.toString();
} else {
* center pixel. In browsers that don't support emoji, the character will be rendered
* as an empty square, so the center pixel will be blank.
*/
- context.fillText( String.fromCharCode( 55357, 56835 ), 0, 0 );
+ context.fillText( stringFromCharCode( 55357, 56835 ), 0, 0 );
} else {
/*
* To check for Unicode 8 support, let's try rendering the most important advancement
* that the Unicode Consortium have made in years: the burrito.
*/
- context.fillText( String.fromCharCode( 55356, 57135 ), 0, 0 );
+ context.fillText( stringFromCharCode( 55356, 57135 ), 0, 0 );
}
return context.getImageData( 16, 16, 1, 1 ).data[0] !== 0;
}
-!function(a,b,c){function d(a){var c,d=b.createElement("canvas"),e=d.getContext&&d.getContext("2d");return e&&e.fillText?(e.textBaseline="top",e.font="600 32px Arial","flag"===a?(e.fillText(String.fromCharCode(55356,56806,55356,56826),0,0),d.toDataURL().length>3e3):"diversity"===a?(e.fillText(String.fromCharCode(55356,57221),0,0),c=e.getImageData(16,16,1,1).data.toString(),e.fillText(String.fromCharCode(55356,57221,55356,57343),0,0),c!==e.getImageData(16,16,1,1).data.toString()):("simple"===a?e.fillText(String.fromCharCode(55357,56835),0,0):e.fillText(String.fromCharCode(55356,57135),0,0),0!==e.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
\ No newline at end of file
+!function(a,b,c){function d(a){var c,d=b.createElement("canvas"),e=d.getContext&&d.getContext("2d"),f=String.fromCharCode;return e&&e.fillText?(e.textBaseline="top",e.font="600 32px Arial","flag"===a?(e.fillText(f(55356,56806,55356,56826),0,0),d.toDataURL().length>3e3):"diversity"===a?(e.fillText(f(55356,57221),0,0),c=e.getImageData(16,16,1,1).data.toString(),e.fillText(f(55356,57221,55356,57343),0,0),c!==e.getImageData(16,16,1,1).data.toString()):("simple"===a?e.fillText(f(55357,56835),0,0):e.fillText(f(55356,57135),0,0),0!==e.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
\ No newline at end of file
return wp_kses( $data, 'post' );
}
+/**
+ * Navigates through an array, object, or scalar, and sanitizes content for
+ * allowed HTML tags for post content.
+ *
+ * @since 4.4.2
+ *
+ * @param mixed $value The array or string to filter.
+ * @return mixed $value The filtered content.
+ */
+function wp_kses_post_deep( $data ) {
+ return map_deep( $data, 'wp_kses_post' );
+}
+
/**
* Strips all of the HTML in the content.
*
wp_cache_init();
if ( function_exists( 'wp_cache_add_global_groups' ) ) {
- wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
+ wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks' ) );
wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
}
}
if ( is_array( $global_groups ) ) {
wp_cache_add_global_groups( $global_groups );
} else {
- wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
+ wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks' ) );
}
wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
}
if ( is_array( $global_groups ) ) {
wp_cache_add_global_groups( $global_groups );
} else {
- wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
+ wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks' ) );
}
wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
}
// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
- $lp = parse_url($test);
+ // @-operator is used to prevent possible warnings in PHP < 5.3.3.
+ $lp = @parse_url($test);
// Give up if malformed URL
if ( false === $lp )
if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
return $default;
- // Reject if scheme is set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
- if ( isset($lp['scheme']) && !isset($lp['host']) )
+ // Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
+ if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
return $default;
+ }
+
+ // Reject malformed components parse_url() can return on odd inputs
+ foreach ( array( 'user', 'pass', 'host' ) as $component ) {
+ if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
+ return $default;
+ }
+ }
$wpp = parse_url(home_url());
$like = '%' . $wpdb->esc_like( $q['s'] ) . '%';
}
- $search_orderby = '(CASE ';
+ $search_orderby = '';
// sentence match in 'post_title'
if ( $like ) {
if ( $like ) {
$search_orderby .= $wpdb->prepare( "WHEN $wpdb->posts.post_content LIKE %s THEN 4 ", $like );
}
- $search_orderby .= 'ELSE 5 END)';
+
+ if ( $search_orderby ) {
+ $search_orderby = '(CASE ' . $search_orderby . 'ELSE 5 END)';
+ }
} else {
// single word or sentence search
$search_orderby = reset( $q['search_orderby_title'] ) . ' DESC';
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global wpdb $wpdb WordPress database abstraction object.
- * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
*/
function wp_old_slug_redirect() {
- global $wp_query, $wp_rewrite;
-
- if ( get_queried_object() ) {
- return;
- }
+ global $wp_query;
- if ( '' !== $wp_query->query_vars['name'] ) :
+ if ( is_404() && '' !== $wp_query->query_vars['name'] ) :
global $wpdb;
// Guess the current post_type based on the query vars.
$link = get_permalink( $id );
- if ( is_feed() ) {
- $link = user_trailingslashit( trailingslashit( $link ) . 'feed' );
- } elseif ( isset( $GLOBALS['wp_query']->query_vars['paged'] ) && $GLOBALS['wp_query']->query_vars['paged'] > 1 ) {
+ if ( isset( $GLOBALS['wp_query']->query_vars['paged'] ) && $GLOBALS['wp_query']->query_vars['paged'] > 1 ) {
$link = user_trailingslashit( trailingslashit( $link ) . 'page/' . $GLOBALS['wp_query']->query_vars['paged'] );
} elseif( is_embed() ) {
$link = user_trailingslashit( trailingslashit( $link ) . 'embed' );
- } elseif ( is_404() ) {
- // Add rewrite endpoints if necessary.
- foreach ( $wp_rewrite->endpoints as $endpoint ) {
- if ( $endpoint[2] && false !== get_query_var( $endpoint[2], false ) ) {
- $link = user_trailingslashit( trailingslashit( $link ) . $endpoint[1] );
- }
- }
}
/**
*
* See ERRATA.md for our reasoning behind this particular order
*/
- if (extension_loaded('libsodium')) {
+ if (PHP_VERSION_ID >= 50300 && extension_loaded('libsodium') && function_exists('\\Sodium\\randombytes_buf')) {
// See random_bytes_libsodium.php
require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
}
function update_term_cache( $terms, $taxonomy = '' ) {
foreach ( (array) $terms as $term ) {
// Create a copy in case the array was passed by reference.
- $_term = $term;
+ $_term = clone $term;
// Object ID should not be cached.
unset( $_term->object_id );
*
* @global string $wp_version
*/
-$wp_version = '4.4.1';
+$wp_version = '4.4.2';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.