Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#35486 closed defect (bug) (fixed)

Pass `$post` to `post_password_required()` in `get_the_excerpt()`

Reported by: sebastianpisula's profile sebastian.pisula Owned by: swissspidy's profile swissspidy
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch has-unit-tests
Focuses: Cc:


Two fix in get_the_excerpt function:

  1. in docs param $post can be int|WP_Post and null
  2. post_password_required function should have $post param

Attachments (2)

35486.patch (909 bytes) - added by sebastian.pisula 8 years ago.
35486.diff (1.4 KB) - added by swissspidy 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
8 years ago

  • Component changed from General to Posts, Post Types
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.5

int|WP_Post|null is used like two or three times throughout the code base, whereas int|WP_Post is used everywhere else. null is the default value and IMHO already covered by int|WP_Post.

The post_password_required() part is a bad oversight though.

8 years ago

#2 @swissspidy
8 years ago

  • Keywords has-patch has-unit-tests added; needs-patch removed
  • Owner set to swissspidy
  • Status changed from new to reviewing
  • Summary changed from Fix in get_the_excerpt to Pass `$post` to `post_password_required()` in `get_the_excerpt()`

#3 @swissspidy
8 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 36329:

Posts: Correctly pass $post to post_password_required() in get_the_excerpt().

Corrects the relevant test.

Props sebastian.pisula for initial patch.
Fixes #35486.

Note: See TracTickets for help on using tickets.