[wp-trac] [WordPress Trac] #33816: Rewrite rules may be flushed incorrectly when home, siteurl, or page_on_front is updated in multisite

WordPress Trac noreply at wordpress.org
Fri Sep 11 00:24:39 UTC 2015


#33816: Rewrite rules may be flushed incorrectly when home, siteurl, or
page_on_front is updated in multisite
---------------------------+----------------------------
 Reporter:  jeremyfelt     |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Future Release
Component:  Rewrite Rules  |    Version:  3.0
 Severity:  normal         |   Keywords:  has-patch
  Focuses:  multisite      |
---------------------------+----------------------------
 Rewrite rules have been flushed when the home url for a site is updated
 for a very long time. See [2494].

 Now, if the `siteurl`, `home`, or `page_on_front` options are updated,
 `update_home_siteurl()` fires and flushes rewrite rules.

 If this happens in `site-info.php` while updating a site's options in a
 switched state, the rewrite rules are deleted and then regenerated in the
 context of the current network's main site. Further up in `site-info.php`,
 we already use `delete_option( 'rewrite_rules' );` directly as we know
 that is a better way to flush rules in a switched context.

 I think the best option here is to add an `ms_is_switched()` check to
 `update_home_siteurl()` and just delete the rewrite_rules option when true
 rather than flush. I haven't fully tested this yet though.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33816>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list