Make WordPress Core


Ignore:
Timestamp:
09/12/2013 05:30:01 PM (11 years ago)
Author:
wonderboymusic
Message:

Fix the failing Tests_Link::test_wp_get_shortlink() assertion:

  • wp_get_shortlink() was firing a notice when reading $post->ID while $post was null in some cases
  • Before the assertions that assume $GLOBALS['post'] is not set, call unset( $GLOBALS['post'] ); - there was global spillage from other tests

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r25340 r25404  
    24182418    } elseif ( 'post' == $context ) {
    24192419        $post = get_post( $id );
    2420         $post_id = $post->ID;
     2420        if ( ! empty( $post->ID ) )
     2421            $post_id = $post->ID;
    24212422    }
    24222423
Note: See TracChangeset for help on using the changeset viewer.