Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#24491 closed defect (bug) (fixed)

get_page_uri() generates PHP warnings when invalid page passed in

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

Description

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 12 years ago.

Download all attachments as: .zip

Change History (5)

@Viper007Bond
12 years ago

#2 @wonderboymusic
12 years ago

  • Milestone changed from Awaiting Review to 3.7

#3 @wonderboymusic
12 years 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.

#4 @nacin
12 years 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.