[wp-trac] [WordPress Trac] #44804: pretty_permalinks capability may not be detected correctly during a fresh install on a server without mod_rewrite

WordPress Trac noreply at wordpress.org
Wed Aug 15 22:25:08 UTC 2018


#44804: pretty_permalinks capability may not be detected correctly during a fresh
install on a server without mod_rewrite
-----------------------------+-----------------------------
 Reporter:  ccprog           |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  4.9.8
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 I have a lighttpd server that has a pretty standard setup: no active
 `mod_rewrite` rules, but a
 [https://redmine.lighttpd.net/projects/lighttpd/wiki/Index-file-
 names_Details index-file] rule that names `index.php` as a index file
 (thus a sort of one-off rewrite). I don't know about other servers, but
 this may be not that uncommon as a default setup.

 Now look at [https://core.trac.wordpress.org/browser/tags/4.9/src/wp-
 admin/includes/upgrade.php#L298
 wp_install_maybe_enable_pretty_permalinks()] in wp-
 admin/includes.upgrade.php. If you look closely, the routine to test for
 active mod_rewrite functionality will ping for `get_permalink(
 $first_post->ID )`, if it already exists. During a fresh install, it
 doesn't, and an empty string is used for testing.

 This leads to a false positive, since the empty path is rerouted despite
 the absence of true rewrite rules. Option `permalink_structure` is set to
 `/%year%/%monthnum%/%day%/%postname%/`, without the leading file name. If
 you go to the settings page later and change the permalink settings, the
 error is corrected and the file name inserted - now the `$first_post`
 exists.

 For almost all practical purposes, this poses no problems, but came to the
 fore in the most obscure of all places: while testing Gutenberg on a fresh
 install, the editor crashed - see
 https://github.com/WordPress/gutenberg/issues/8899.

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


More information about the wp-trac mailing list