[wp-trac] [WordPress Trac] #28517: Logic error in WP_Rewrite flush_rules

WordPress Trac noreply at wordpress.org
Sun Oct 26 22:08:50 UTC 2014


#28517: Logic error in WP_Rewrite flush_rules
-------------------------------------------------+-------------------------
 Reporter:  numis                                |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Rewrite Rules                        |  Review
 Severity:  normal                               |     Version:  3.7
 Keywords:  has-patch needs-testing needs-unit-  |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by markjaquith):

 Replying to [comment:7 aaroncampbell]:
 > I agree with the general fix here (passing `$hard` to the filter so it
 can override what's passed in), but I'm not sure about returning true and
 false. True and false for a function like this should denote success and
 failure, but that's not the case here. The patch is returning false to say
 "we did a soft flush, not a hard one" and true to say "we attempted a hard
 flush". I see that you're using the return for unit tests, but I think we
 need to find a better way to handle those tests.

 Eh. True/false doesn't necessarily need to indicate success and failure.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28517#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list