get_the_excerpt() missing a check on $post->post_excerpt
|Reported by:||johnjamesjacoby||Owned by:|
Functions like get_the_title() include isset() or !empty() checks on post object variables, but get_the_excerpt() is missing any such check. This missing check triggers PHP warnings if post_excerpt is not set.
has_excerpt() addresses this for template usage, but nothing addresses this inside get_the_excerpt() itself.
Attached patch adds an isset() check, and correctly passes an empty string if it doesn't.
(Possibly of note: other convenience functions have this same issue -- get_the_guid(), get_the_ID(), etc...)
Change History (9)
comment:7 aaroncampbell — 10 months ago
- Milestone 3.6 deleted
- Resolution set to invalid
- Status changed from new to closed