Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#24491 closed defect (bug) (fixed)

get_page_uri() generates PHP warnings when invalid page passed in

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

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

Download all attachments as: .zip

Change History (5)

@Viper007Bond
13 years ago

#2 @wonderboymusic
13 years ago

  • Milestone Awaiting Review3.7

#3 @wonderboymusic
13 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 25262:

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

Props Viper007Bond.
Fixes #24491.

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