Skip to content

Commit 394bec7

Browse files
Merge branch 'trunk' into add-dimension-validation-to-sideload
2 parents 5474fcd + 976ca47 commit 394bec7

13 files changed

Lines changed: 432 additions & 17 deletions

src/wp-admin/includes/class-wp-media-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public function column_title( $post ) {
493493
'<a href="%s">',
494494
get_edit_post_link( $post->ID ),
495495
);
496-
$link_end = '</a>';
496+
$link_end = '</a>';
497497
}
498498

499499
$class = $thumb ? ' class="has-media-icon"' : '';

src/wp-includes/author-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function get_the_author_posts_link() {
334334

335335
$author = get_the_author();
336336
/* translators: %s: Author's display name. */
337-
$title = sprintf( __( 'Posts by %s' ), $author );
337+
$title = sprintf( __( 'Posts by %s' ), $author );
338338

339339
$link = sprintf(
340340
'<a href="%1$s" rel="author">%2$s</a>',

src/wp-includes/class-wp-comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static function get_instance( $id ) {
210210
*
211211
* @since 4.4.0
212212
*
213-
* @param WP_Comment $comment Comment object.
213+
* @param object $comment Comment object.
214214
*/
215215
public function __construct( $comment ) {
216216
foreach ( get_object_vars( $comment ) as $key => $value ) {

src/wp-includes/class-wp-post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public static function get_instance( $post_id ) {
260260
*
261261
* @since 3.5.0
262262
*
263-
* @param WP_Post|object $post Post object.
263+
* @param object $post Post object.
264264
*/
265265
public function __construct( $post ) {
266266
foreach ( get_object_vars( $post ) as $key => $value ) {

src/wp-includes/class-wp-site.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public static function get_instance( $site_id ) {
190190
*
191191
* @since 4.5.0
192192
*
193-
* @param WP_Site|object $site A site object.
193+
* @param object $site A site object.
194194
*/
195195
public function __construct( $site ) {
196196
foreach ( get_object_vars( $site ) as $key => $value ) {

src/wp-includes/class-wp-term.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public static function get_instance( $term_id, $taxonomy = null ) {
192192
*
193193
* @since 4.4.0
194194
*
195-
* @param WP_Term|object $term Term object.
195+
* @param object $term Term object.
196196
*/
197197
public function __construct( $term ) {
198198
foreach ( get_object_vars( $term ) as $key => $value ) {

src/wp-includes/class-wp-user.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ class WP_User {
121121
*
122122
* @global wpdb $wpdb WordPress database abstraction object.
123123
*
124-
* @param int|string|stdClass|WP_User $id User's ID, a WP_User object, or a user object from the DB.
125-
* @param string $name Optional. User's username
126-
* @param int $site_id Optional Site ID, defaults to current site.
124+
* @param int|string|object $id User's ID, a WP_User object, or a user object from the DB.
125+
* @param string $name Optional. User's username
126+
* @param int $site_id Optional Site ID, defaults to current site.
127127
*/
128128
public function __construct( $id = 0, $name = '', $site_id = 0 ) {
129129
global $wpdb;

src/wp-includes/collaboration/class-wp-sync-post-meta-storage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function add_update( string $room, $update ): bool {
8585
'value' => $update,
8686
);
8787

88-
return (bool) add_post_meta( $post_id, self::SYNC_UPDATE_META_KEY, $envelope, false );
88+
return (bool) add_post_meta( $post_id, wp_slash( self::SYNC_UPDATE_META_KEY ), wp_slash( $envelope ), false );
8989
}
9090

9191
/**
@@ -162,7 +162,7 @@ public function set_awareness_state( string $room, array $awareness ): bool {
162162
}
163163

164164
// update_post_meta returns false if the value is the same as the existing value.
165-
update_post_meta( $post_id, self::AWARENESS_META_KEY, $awareness );
165+
update_post_meta( $post_id, wp_slash( self::AWARENESS_META_KEY ), wp_slash( $awareness ) );
166166
return true;
167167
}
168168

@@ -305,7 +305,7 @@ public function remove_updates_before_cursor( string $room, int $cursor ): bool
305305
$all_updates = $this->get_all_updates( $room );
306306

307307
// Remove all updates for the room and re-store only those that are newer than the cursor.
308-
if ( ! delete_post_meta( $post_id, self::SYNC_UPDATE_META_KEY ) ) {
308+
if ( ! delete_post_meta( $post_id, wp_slash( self::SYNC_UPDATE_META_KEY ) ) ) {
309309
return false;
310310
}
311311

src/wp-includes/post.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ function get_extended( $post ) {
11351135
*
11361136
* @global WP_Post $post Global post object.
11371137
*
1138-
* @param int|WP_Post|null $post Optional. Post ID or post object. `null`, `false`, `0` and other PHP falsey values
1138+
* @param int|object|null $post Optional. Post ID or post object. `null`, `false`, `0` and other PHP falsey values
11391139
* return the current global post inside the loop. A numerically valid post ID that
11401140
* points to a non-existent post returns `null`. Defaults to global $post.
11411141
* @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
@@ -1159,8 +1159,10 @@ function get_post( $post = null, $output = OBJECT, $filter = 'raw' ) {
11591159
$_post = new WP_Post( $_post );
11601160
} elseif ( 'raw' === $post->filter ) {
11611161
$_post = new WP_Post( $post );
1162-
} else {
1162+
} elseif ( isset( $post->ID ) ) {
11631163
$_post = WP_Post::get_instance( $post->ID );
1164+
} else {
1165+
$_post = null;
11641166
}
11651167
} else {
11661168
$_post = WP_Post::get_instance( $post );

src/wp-includes/rest-api/class-wp-rest-server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,9 +1391,9 @@ public function get_index( $request ) {
13911391
/** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
13921392
$available['jpeg_interlaced'] = (bool) apply_filters( 'image_save_progressive', false, 'image/jpeg' );
13931393
/** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
1394-
$available['png_interlaced'] = (bool) apply_filters( 'image_save_progressive', false, 'image/png' );
1394+
$available['png_interlaced'] = (bool) apply_filters( 'image_save_progressive', false, 'image/png' );
13951395
/** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
1396-
$available['gif_interlaced'] = (bool) apply_filters( 'image_save_progressive', false, 'image/gif' );
1396+
$available['gif_interlaced'] = (bool) apply_filters( 'image_save_progressive', false, 'image/gif' );
13971397
}
13981398

13991399
$response = new WP_REST_Response( $available );

0 commit comments

Comments
 (0)