diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
index 296a699..634f9a8 100644
|
|
function populate_options() { |
397 | 397 | 'links_updated_date_format' => __('F j, Y g:i a'), |
398 | 398 | 'comment_moderation' => 0, |
399 | 399 | 'moderation_notify' => 1, |
400 | | 'permalink_structure' => '', |
| 400 | 'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/', |
401 | 401 | 'gzipcompression' => 0, |
402 | 402 | 'hack_file' => 0, |
403 | 403 | 'blog_charset' => 'UTF-8', |
… |
… |
function populate_options() { |
495 | 495 | if ( is_multisite() ) { |
496 | 496 | /* translators: blog tagline */ |
497 | 497 | $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), get_current_site()->site_name ); |
498 | | $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/'; |
499 | 498 | } |
500 | 499 | |
501 | 500 | // Set autoload to no for these options |
diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
index b72303a..9524076 100644
|
|
function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated |
87 | 87 | |
88 | 88 | wp_install_defaults($user_id); |
89 | 89 | |
| 90 | wp_install_verify_pretty_permalinks(); |
| 91 | |
90 | 92 | flush_rewrite_rules(); |
91 | 93 | |
92 | 94 | wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) ); |
… |
… |
As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d |
260 | 262 | } |
261 | 263 | endif; |
262 | 264 | |
| 265 | if ( !function_exists('wp_install_verify_pretty_permalinks') ) : |
| 266 | /** |
| 267 | * Verify pretty permalinks. |
| 268 | * |
| 269 | * This function will verify that pretty permalinks work. |
| 270 | * If pretty permalinks fail to work, the web-server will fall |
| 271 | * back to ugly permalinks by setting an empty permalink structure. |
| 272 | * |
| 273 | * @since 4.2.0 |
| 274 | * |
| 275 | * @return void |
| 276 | */ |
| 277 | function wp_install_verify_pretty_permalinks() { |
| 278 | global $wp_rewrite; |
| 279 | // Flush rules with the hard option to force refresh of the web-server's |
| 280 | // rewrite config file (e.g. .htaccess or web.config). |
| 281 | $wp_rewrite->flush_rules( true ); |
| 282 | |
| 283 | // Send a HEAD request to a random page on the site, |
| 284 | // and check whether the 'x-pingback' header is returned as expected. |
| 285 | $response = wp_remote_get( site_url( '/some-random-404-page/' ) ); |
| 286 | $x_pingback_header = wp_remote_retrieve_header( $response, 'x-pingback' ); |
| 287 | $pretty_permalinks = $x_pingback_header && $x_pingback_header === get_bloginfo( 'pingback_url' ); |
| 288 | |
| 289 | // Set an empty permalink structure to make it ugly again. |
| 290 | if ( ! $pretty_permalinks ) { |
| 291 | $wp_rewrite->set_permalink_structure(''); |
| 292 | } |
| 293 | } |
| 294 | endif; |
| 295 | |
263 | 296 | if ( !function_exists('wp_new_blog_notification') ) : |
264 | 297 | /** |
265 | 298 | * {@internal Missing Short Description}} |