WordPress.org

Make WordPress Core

Ticket #44052: 44052.5.diff

File 44052.5.diff, 987 bytes (added by lbenicio, 21 months ago)
  • src/wp-login.php

    diff --git a/src/wp-login.php b/src/wp-login.php
    index e02208ae56..363b7bfc32 100644
    a b function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { 
    3838
    3939        add_action( 'login_head', 'wp_login_viewport_meta' );
    4040
    41         if ( empty( $wp_error ) ) {
     41        if ( ! is_wp_error( $wp_error ) ) {
    4242                $wp_error = new WP_Error();
    4343        }
    4444
  • tests/phpunit/tests/http/getHttpHeaders.php

    diff --git a/tests/phpunit/tests/http/getHttpHeaders.php b/tests/phpunit/tests/http/getHttpHeaders.php
    index ccb6b4f545..d4a03a82e1 100644
    a b class Tests_HTTP_GetHttpHeaders extends WP_UnitTestCase { 
    5050                wp_get_http_headers( 'does_not_matter', $deprecated = true );
    5151        }
    5252
     53        /**
     54         * Test to check if login_header is getting error argument.
     55         */
     56
     57        public function test_wp_get_http_headers_login() {
     58                $result = login_header( 'Log In', '', 'Test.' );
     59                $this->assertWPError();
     60        }
     61