Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ includes:
- tests/phpstan/baselines/argument.type.neon
- tests/phpstan/baselines/argument.unresolvableType.neon
- tests/phpstan/baselines/assign.propertyType.neon
- tests/phpstan/baselines/binaryOp.invalid.neon
- tests/phpstan/baselines/booleanAnd.alwaysFalse.neon
- tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon
- tests/phpstan/baselines/booleanNot.alwaysTrue.neon
Expand Down
4 changes: 2 additions & 2 deletions src/wp-content/themes/twentytwenty/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ function twentytwenty_get_custom_logo( $html ) {

if ( $logo ) {
// For clarity.
$logo_width = esc_attr( $logo[1] );
$logo_height = esc_attr( $logo[2] );
$logo_width = absint( $logo[1] );
$logo_height = absint( $logo[2] );

// If the retina logo setting is active, reduce the width/height by half.
if ( get_theme_mod( 'retina_logo', false ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ function get_page_of_comment( $comment_id, $args = array() ) {
* (trackbacks and pingbacks), or 'all'. Default 'all'.
* @type int $post_id ID of the post.
* @type string $fields Comment fields to return.
* @type bool $count Whether to return a comment count (true) or array
* of comment objects (false).
* @type true $count Required. Whether to return a comment count. Must be
* true, because the page number is calculated from it.
* @type string $status Comment status.
* @type int $parent Parent ID of comment to retrieve children of.
* @type array $date_query Date query clauses to limit comments by. See WP_Date_Query.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -3236,7 +3236,7 @@ function check_password_reset_key(

if ( str_contains( $user->user_activation_key, ':' ) ) {
list( $pass_request_time, $pass_key ) = explode( ':', $user->user_activation_key, 2 );
$expiration_time = $pass_request_time + $expiration_duration;
$expiration_time = (int) $pass_request_time + $expiration_duration;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 21b3316

} else {
$pass_key = $user->user_activation_key;
$expiration_time = false;
Expand Down
35 changes: 0 additions & 35 deletions tests/phpstan/baselines/binaryOp.invalid.neon

This file was deleted.

24 changes: 24 additions & 0 deletions tests/phpunit/tests/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,30 @@ public function test_expired_user_activation_key_is_rejected() {
$this->assertSame( 'expired_key', $check->get_error_code() );
}

/**
* @ticket 65817
*/
public function test_user_activation_key_with_non_numeric_timestamp_is_rejected() {
global $wpdb;

$key = wp_generate_password( 20, false );
$wpdb->update(
$wpdb->users,
array(
'user_activation_key' => 'not-a-timestamp:' . wp_fast_hash( $key ),
),
array(
'ID' => $this->user->ID,
)
);
clean_user_cache( $this->user );

// A key with a valid hash but a malformed timestamp should be rejected as expired.
$check = check_password_reset_key( $key, $this->user->user_login );
$this->assertWPError( $check );
$this->assertSame( 'expired_key', $check->get_error_code() );
}

/**
* @ticket 32429
*/
Expand Down
Loading