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

WordPress Trac noreply at wordpress.org
Sun Jun 15 10:45:00 UTC 2014


#28517: Logic error in WP_Rewrite flush_rules
---------------------------+------------------------------
 Reporter:  numis          |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:
---------------------------+------------------------------
Changes (by Denis-de-Bernardy):

 * keywords:  has-patch => needs-patch


Comment:

 Besides the fact that some are actually using this filter with the current
 defaults and all, I see two problems with the current patch.

 Firstly I disagree with this here:

 > If $hard is true and a filter is added that returns false:
 > UNINTENTIONAL FAILURE - SOFT FLUSH PERFORMED

 I view this one as intentional… If I filter the value and explicitly
 return false, I do not care if WP would have rather have it hard flushed.
 I meant it. (And for good reasons, since WP fails to edit the correct
 htaccess file in some edge cases.)

 > If $hard is false and either no filters are added, or a filter is added
 that returns true:
 > UNINTENTIONAL FAILURE - SOFT FLUSH PERFORMED

 This seems like a more valid bug.

 Put together, methinks the correct patch would change the logic so it
 simply filters `$hard` instead of true.

 Secondly, the new return value should be documented and, ideally, should
 be a boolean (e.g. true if a hard flush was done) rather than arbitrary
 strings.

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


More information about the wp-trac mailing list