WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#15087 closed defect (bug) (duplicate)

notice causing warning in rewrite.php

Reported by: davidsword Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.1
Component: Rewrite Rules Keywords:
Focuses: Cc:

Description

in wp-login, and other pages in the admin and site - while having debug enabled, multi-site in use, and a url rewrite of: /%postname%/%post_id%/

gives me Notice: Trying to get property of non-object in ..../wp-includes/rewrite.php on line 341 which prints a header output warning crippling the page..

turning debug off hides this. but adding is_object() in line 341 as below:

if ( is_object( $query->post ) && ( $query->is_single || $query->is_page )  )

solves the problem.

(I don't know if this is helpful & what you're suposed to submit to trac, but it's just been bugging me on a lot of sites, thought I'd make a note of it)

Attachments (1)

includes.patch (453 bytes) - added by mrmist 5 years ago.

Download all attachments as: .zip

Change History (4)

@mrmist5 years ago

comment:1 @mrmist5 years ago

  • Keywords has-patch added

Attached davidsword's suggestion in patch form. Not checked it myself.

comment:2 @scribu5 years ago

  • Keywords reporter-feedback added

Can't reproduce.

comment:3 @ocean904 years ago

  • Keywords has-patch reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.