Skip to content

Commit e517a36

Browse files
committed
Correctly calculate the location of wp-config.php, used in the instructions for setting up a network. see #22639.
git-svn-id: https://develop.svn.wordpress.org/trunk@22980 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f88b538 commit e517a36

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

wp-admin/network.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ function network_step2( $errors = false ) {
316316
$wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
317317
$rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
318318

319+
$location_of_wp_config = ABSPATH;
320+
if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) )
321+
$location_of_wp_config = trailingslashit( dirname( ABSPATH ) );
322+
319323
// Wildcard DNS message.
320324
if ( is_wp_error( $errors ) )
321325
echo '<div class="error">' . $errors->get_error_message() . '</div>';
@@ -360,7 +364,7 @@ function network_step2( $errors = false ) {
360364
}
361365
?>
362366
<ol>
363-
<li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That&#8217;s all, stop editing! Happy blogging. */</code>:' ), ABSPATH ); ?></p>
367+
<li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That&#8217;s all, stop editing! Happy blogging. */</code>:' ), $location_of_wp_config ); ?></p>
364368
<textarea class="code" readonly="readonly" cols="100" rows="6">
365369
define('MULTISITE', true);
366370
define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>);

0 commit comments

Comments
 (0)