Make WordPress Core

Opened 11 months ago

Closed 8 months ago

Last modified 8 months ago

#24491 closed defect (bug) (fixed)

get_page_uri() generates PHP warnings when invalid page passed in

Reported by: Viper007Bond Owned by: wonderboymusic
Milestone: 3.7 Priority: normal
Severity: normal Version: 3.5.1
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:


get_page_uri() needs to make sure a valid result came back from the get_post() call before trying to access properties of $page, otherwise warnings are generated.

Attachments (1)

24491.patch (663 bytes) - added by Viper007Bond 11 months ago.

Download all attachments as: .zip

Change History (5)

Viper007Bond11 months ago

comment:2 wonderboymusic8 months ago

  • Milestone changed from Awaiting Review to 3.7

comment:3 wonderboymusic8 months ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 25262:

Add check to make sure a valid argument was passed to get_page_uri().

Props Viper007Bond.
Fixes #24491.

comment:4 nacin8 months ago

In 25265:

Add a test case for calling get_page_uri() with a non-existent post.

see #24491, [25262].

Note: See TracTickets for help on using tickets.