Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#47087 closed defect (bug) (fixed)

flush_rewrite_rules() should check $wp_rewrite->flush_rules() is callable before calling it

Reported by: markjaquith Owned by: SergeyBiryukov
Priority: normal Milestone: 5.3
Component: Rewrite Rules Version:
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses:

Description

I ran into this situation:

Uncaught Error: Call to a member function flush_rules() on null

when some code was running flush_rewrite_rules() on shutdown.

flush_rewrite_rules() should do a sanity check before calling, so it never causes a fatal error.

Attachments (1)

47087.diff (455 bytes ) - added by bsetiawan88 7 years ago.

Download all attachments as: .zip

Change History (4)

#1 @desrosj
7 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone Awaiting ReviewFuture Release

@bsetiawan88
7 years ago

#2 @SergeyBiryukov
7 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone Future Release5.3
  • Owner set to SergeyBiryukov
  • Status newreviewing

#3 @SergeyBiryukov
7 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 45699:

Rewrite Rules: Check if $wp_rewrite->flush_rules() is callable before calling it in flush_rewrite_rules().

Props bsetiawan88, markjaquith.
Fixes #47087.

Note: See TracTickets for help on using tickets.