<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12865] trunk/wp-admin/network.php: Whitespace cleanup and inline docs.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12865">12865</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-27 13:48:37 +0000 (Wed, 27 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Whitespace cleanup and inline docs. Props nacin. see <a href="http://trac.wordpress.org/ticket/12027">#12027</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminnetworkphp">trunk/wp-admin/network.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminnetworkphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network.php (12864 => 12865)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network.php        2010-01-27 02:59:26 UTC (rev 12864)
+++ trunk/wp-admin/network.php        2010-01-27 13:48:37 UTC (rev 12865)
</span><span class="lines">@@ -2,30 +2,28 @@
</span><span class="cx"> /**
</span><span class="cx"> * Network settings administration panel.
</span><span class="cx"> *
</span><del>- * @since 3.0
</del><ins>+ * A multi-step process allowing the user to enable a network of WordPress sites.
</ins><span class="cx"> *
</span><ins>+ * @since 3.0.0
+ *
</ins><span class="cx"> * @package WordPress
</span><span class="cx"> * @subpackage Administration
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><del>-require_once('./admin.php');
</del><ins>+require_once( './admin.php' );
</ins><span class="cx">
</span><span class="cx"> if ( ! is_super_admin() )
</span><del>-        wp_die(__('You do not have sufficient permissions to manage options for this blog.'));
</del><ins>+        wp_die( __( 'You do not have sufficient permissions to manage options for this blog.' ) );
</ins><span class="cx">
</span><del>-$title = __('Network Settings');
</del><ins>+$title = __( 'Network Settings' );
</ins><span class="cx"> $parent_file = 'tools.php';
</span><span class="cx">
</span><del>-add_contextual_help($current_screen, __('<a href="http://codex.wordpress.org/Settings_Network_SubPanel" target="_blank">Network Settings</a>'));
</del><ins>+add_contextual_help( $current_screen, __( '<a href="http://codex.wordpress.org/Settings_Network_SubPanel" target="_blank">Network Settings</a>') );
</ins><span class="cx">
</span><del>-include('./admin-header.php');
-/*
-This option panel does not save data to the options table.
-It contains a multi-step process allowing the user to enable a network of WordPress sites.
-*/
</del><ins>+include( './admin-header.php' );
</ins><span class="cx">
</span><del>-$dirs = array( substr( ABSPATH, 0, -1), ABSPATH . "wp-content" );
</del><ins>+$dirs = array( substr( ABSPATH, 0, -1 ), ABSPATH . 'wp-content' );
</ins><span class="cx"> ?>
</span><span class="cx"> <div class="wrap">
</span><span class="cx"> <?php screen_icon(); ?>
</span><span class="lines">@@ -33,91 +31,107 @@
</span><span class="cx">
</span><span class="cx"> <form method="post" action="network.php">
</span><span class="cx"> <?php
</span><ins>+/**
+ * Prints summary of server statistics in preparation for setting up a network.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> function filestats( $err ) {
</span><span class="cx"> ?>
</span><del>-        <h2><?php esc_html_e('Server Summary'); ?></h2>
-        <p><?php _e('If you post a message to the WordPress support forum at <a target="_blank" href="http://wordpress.org/support/">http://wordpress.org/support/</a> then copy and paste the following information into your message:'); ?></p>
</del><ins>+        <h2><?php esc_html_e( 'Server Summary' ); ?></h2>
+        <p><?php _e( 'If you post a message to the WordPress support forum at <a target="_blank" href="http://wordpress.org/support/">http://wordpress.org/support/</a> then copy and paste the following information into your message:' ); ?></p>
</ins><span class="cx">         <blockquote style="background: #eee; border: 1px solid #333; padding: 5px;">
</span><del>-        <br /><strong><?php echo __('ERROR:') . " $err"; ?></strong><br />
</del><ins>+        <br /><strong><?php printf( __( 'ERROR: %s' ), $err ); ?></strong><br />
</ins><span class="cx"> <?php
</span><span class="cx">         clearstatcache();
</span><del>-        $files = array( "htaccess.dist", ".htaccess" );
</del><ins>+        $files = array( 'htaccess.dist', '.htaccess' );
</ins><span class="cx">
</span><span class="cx">         $indent = '&nbsp;&nbsp;&nbsp;&nbsp;';
</span><span class="cx">         foreach ( (array) $files as $val ) {
</span><span class="cx">                 $stats = @stat( $val );
</span><del>-                if( $stats ) {
</del><ins>+                if ( $stats ) {
</ins><span class="cx"> ?>
</span><span class="cx">                         <h2><?php echo esc_html( $val ); ?></h2>
</span><del>-                        <?php echo $indent . sprintf( __('uid/gid: %1$s/%2$s'), $stats[ 'uid' ], $stats[ 'gid' ] ); ?><br />
-                        <?php echo $indent . sprintf( __('size: %s'), $stats['size'] ); ?><br/>
-                        <?php echo $indent . sprintf( __('perms: %s'), substr( sprintf('%o', fileperms( $val ) ), -4 ) ); ?><br/>
-                        <?php echo $indent . sprintf( __('readable: %s'), is_readable( $val ) ? __('yes') : __('no') ); ?><br/>
-                        <?php echo $indent . sprintf( __('writeable: %s'), is_writeable( $val ) ? __('yes') : __('no') ); ?><br/>
</del><ins>+                        <?php echo $indent . sprintf( __( 'uid/gid: %1$s/%2$s' ), $stats['uid'], $stats['gid'] ); ?><br />
+                        <?php echo $indent . sprintf( __( 'size: %s' ), $stats['size'] ); ?><br/>
+                        <?php echo $indent . sprintf( __( 'perms: %s' ), substr( sprintf( '%o', fileperms( $val ) ), -4 ) ); ?><br/>
+                        <?php echo $indent . sprintf( __( 'readable: %s' ), is_readable( $val ) ? __( 'yes' ) : __( 'no' ) ); ?><br/>
+                        <?php echo $indent . sprintf( __( 'writeable: %s' ), is_writeable( $val ) ? __( 'yes' ) : __( 'no' ) ); ?><br/>
</ins><span class="cx"> <?php
</span><del>-                } elseif( ! file_exists( $val ) ) {
</del><ins>+                } elseif ( ! file_exists( $val ) ) {
</ins><span class="cx"> ?>
</span><span class="cx">                         <h2><?php echo esc_html( $val ); ?></h2>
</span><del>-                        <?php echo $indent . sprintf( __('FILE NOT FOUND: %s'), $val ); ?><br/>
</del><ins>+                        <?php echo $indent . sprintf( __( 'FILE NOT FOUND: %s' ), $val ); ?><br/>
</ins><span class="cx"> <?php
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         echo "</blockquote>";
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Prints .htaccess component of step 2 for network settings.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> function step2_htaccess() {
</span><span class="cx">         global $base;
</span><span class="cx">
</span><span class="cx">         // remove ending slash from $base and $url
</span><span class="cx">         $htaccess = '';
</span><del>-        if( substr($base, -1 ) == '/') {
-                $base = substr($base, 0, -1);
-        }
</del><ins>+        if ( substr( $base, -1 ) == '/' )
+                $base = substr( $base, 0, -1 );
+
</ins><span class="cx">         $htaccess_sample = ABSPATH . 'wp-admin/includes/htaccess.ms';
</span><del>-        if ( !file_exists( $htaccess_sample ) )
-                wp_die( sprintf( __('Sorry, I need a %s to work from. Please re-upload this file to your WordPress installation.'), $htaccess_sample ) );
</del><ins>+        if ( ! file_exists( $htaccess_sample ) )
+                wp_die( sprintf( __( 'Sorry, I need a %s to work from. Please re-upload this file to your WordPress installation.' ), $htaccess_sample ) );
</ins><span class="cx">
</span><span class="cx">         $htaccess_file = file( $htaccess_sample );
</span><span class="cx">         $fp = @fopen( $htaccess_sample, "r" );
</span><del>-        if( $fp ) {
-                while( !feof( $fp ) ) {
</del><ins>+        if ( $fp ) {
+                while ( ! feof( $fp ) ) {
</ins><span class="cx">                         $htaccess .= fgets( $fp, 4096 );
</span><span class="cx">                 }
</span><span class="cx">                 fclose( $fp );
</span><span class="cx">                 $htaccess_file = str_replace( "BASE", $base, $htaccess );
</span><span class="cx">         } else {
</span><del>-                wp_die( sprintf( __('Sorry, I need to be able to read %s. Please check the permissions on this file.'), $htaccess_sample ) );
</del><ins>+                wp_die( sprintf( __( 'Sorry, I need to be able to read %s. Please check the permissions on this file.' ), $htaccess_sample ) );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         //@todo: check for super-cache in use
</span><span class="cx"> ?>
</span><del>-                        <li><p><?php _e('Replace the contents of your <code>.htaccess</code> with the following:'); ?></p>
</del><ins>+                        <li><p><?php _e( 'Replace the contents of your <code>.htaccess</code> with the following:' ); ?></p>
</ins><span class="cx">                                 <textarea name="htaccess" cols="120" rows="20">
</span><del>-<?php echo $htaccess_file; ?>
</del><ins>+<?php echo wp_htmledit_pre( $htaccess_file ); ?>
</ins><span class="cx">                                 </textarea>
</span><span class="cx">                         </li>
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Prints part of step 1 for network settings and checks for mod_rewrite.
+ *
+ * @since 3.0.0
+ * @return bool Whether mod_rewrite is enabled.
+ */
</ins><span class="cx"> function step1() {
</span><span class="cx">         $rewrite_enabled = false;
</span><span class="cx">         ?>
</span><del>-        <h2><?php esc_html_e('Installing Network of WordPress Sites'); ?></h2>
-        <p><?php _e('I will help you enable the features for creating a network of sites by asking you a few questions so that you can create configuration files and make a directory to store all your uploaded files.'); ?></p>
</del><ins>+        <h2><?php esc_html_e( 'Installing Network of WordPress Sites' ); ?></h2>
+        <p><?php _e( 'I will help you enable the features for creating a network of sites by asking you a few questions so that you can create configuration files and make a directory to store all your uploaded files.' ); ?></p>
</ins><span class="cx">
</span><del>-        <h2><?php esc_html_e('What do I need?'); ?></h2>
</del><ins>+        <h2><?php esc_html_e( 'What do I need?' ); ?></h2>
</ins><span class="cx">         <ul>
</span><span class="cx">                 <li><?php _e( 'Access to your server to change directory permissions. This can be done through ssh or ftp for example.' ); ?></li>
</span><span class="cx">                 <li><?php _e( 'A valid email where your password and administrative emails will be sent.' ); ?></li>
</span><del>-                <li><?php _e( "Wildcard dns records if you're going to use the virtual host (sub-domain) functionality. Check the <a href='http://trac.mu.wordpress.org/browser/trunk/README.txt'>README</a> for further details."); ?></li>
</del><ins>+                <li><?php _e( "Wildcard dns records if you're going to use the virtual host (sub-domain) functionality. Check the <a href='http://trac.mu.wordpress.org/browser/trunk/README.txt'>README</a> for further details." ); ?></li>
</ins><span class="cx">         </ul>
</span><span class="cx">         <?php
</span><del>-        $mod_rewrite_msg = "\n<p>" . __( "If the <code>mod_rewrite</code> module is disabled ask your administrator to enable that module, or look at the <a href='http://httpd.apache.org/docs/mod/mod_rewrite.html'>Apache documentation</a> or <a href='http://www.google.com/search?q=apache+mod_rewrite'>elsewhere</a> for help setting it up." ) . '</p>';
</del><ins>+        $mod_rewrite_msg = "\n<p>" . __( 'If the <code>mod_rewrite</code> module is disabled ask your administrator to enable that module, or look at the <a href="http://httpd.apache.org/docs/mod/mod_rewrite.html">Apache documentation</a> or <a href="http://www.google.com/search?q=apache+mod_rewrite">elsewhere</a> for help setting it up.' ) . '</p>';
</ins><span class="cx">
</span><span class="cx">         if ( function_exists( 'apache_get_modules' ) ) {
</span><span class="cx">                 $modules = apache_get_modules();
</span><span class="cx">                 if ( ! in_array( 'mod_rewrite', $modules ) )
</span><del>-                        echo '<p>' . __('<strong>Warning!</strong> It looks like mod_rewrite is not installed.') . '</p>' . $mod_rewrite_msg;
</del><ins>+                        echo '<p>' . __( '<strong>Warning!</strong> It looks like mod_rewrite is not installed.' ) . '</p>' . $mod_rewrite_msg;
</ins><span class="cx">                 else
</span><span class="cx">                         $rewrite_enabled = true;
</span><span class="cx">         } else {
</span><span class="lines">@@ -126,11 +140,17 @@
</span><span class="cx">         return $rewrite_enabled;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Prints most of step 1 for network settings.
+ *
+ * @since 3.0.0
+ * @param bool $rewrite_enabled Whether mod_rewrite is enabled. Default false.
+ */
</ins><span class="cx"> function printstep1form( $rewrite_enabled = false ) {
</span><del>-        $weblog_title = sprintf( __('%s Sites'), ucfirst( get_option( 'blogname' ) ) );
</del><ins>+        $weblog_title = sprintf( __( '%s Sites' ), ucfirst( get_option( 'blogname' ) ) );
</ins><span class="cx">         $email = get_option( 'admin_email' );
</span><span class="cx">         $hostname = get_clean_basedomain();
</span><del>-        if( substr( $hostname, 0, 4 ) == 'www.' )
</del><ins>+        if ( substr( $hostname, 0, 4 ) == 'www.' )
</ins><span class="cx">                 $nowww = substr( $hostname, 4 );
</span><span class="cx">
</span><span class="cx">         wp_nonce_field( 'install-network-1' );
</span><span class="lines">@@ -138,12 +158,12 @@
</span><span class="cx">                 <input type='hidden' name='action' value='step2' />
</span><span class="cx">                 <h2><?php esc_html_e( 'Site Addresses' ); ?></h2>
</span><span class="cx">                 <p><?php _e( 'Please choose whether you would like sites in your WordPress install to use sub-domains or sub-directories. You cannot change this later.' ); ?></p>
</span><del>-                <?php if ( !$rewrite_enabled ) { ?>
-                <p><?php _e( '<strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.'); ?></p>
</del><ins>+                <?php if ( ! $rewrite_enabled ) { ?>
+                <p><?php _e( '<strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.' ); ?></p>
</ins><span class="cx">                 <?php } ?>
</span><span class="cx">                 <p class="blog-address">
</span><del>-                        <label><input type='radio' name='vhost' value='yes'<?php if( $rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-domains (like <code>blog1.example.com</code>)' ); ?></label><br />
-                        <label><input type='radio' name='vhost' value='no'<?php if( !$rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-directories (like <code>example.com/blog1</code>) '); ?></label>
</del><ins>+                        <label><input type='radio' name='vhost' value='yes'<?php if ( $rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-domains (like <code>blog1.example.com</code>)' ); ?></label><br />
+                        <label><input type='radio' name='vhost' value='no'<?php if ( ! $rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-directories (like <code>example.com/blog1</code>)' ); ?></label>
</ins><span class="cx">                 </p>
</span><span class="cx">
</span><span class="cx">                 <h2><?php esc_html_e( 'Server Address' ); ?></h2>
</span><span class="lines">@@ -182,6 +202,11 @@
</span><span class="cx">         <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Prints step 2 for network settings.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> function step2() {
</span><span class="cx"> ?>
</span><span class="cx">                 <h2><?php esc_html_e( 'Enabling WordPress Sites' ); ?></h2>
</span><span class="lines">@@ -194,14 +219,19 @@
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Prints configuration file component of step 2 for network settings.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> function step2_config() {
</span><span class="cx">         global $base, $wpdb, $vhost;
</span><span class="cx">
</span><del>-        $vhost = stripslashes($_POST['vhost' ]);
</del><ins>+        $vhost = stripslashes( $_POST['vhost' ] );
</ins><span class="cx">         $prefix = $wpdb->base_prefix;
</span><span class="cx">
</span><span class="cx">         $config_sample = ABSPATH . 'wp-admin/includes/wp-config.ms';
</span><del>-        if ( !file_exists( $config_sample ) )
</del><ins>+        if ( ! file_exists( $config_sample ) )
</ins><span class="cx">                 wp_die( sprintf( __( 'Sorry, I need a <code>%s</code> to work from. Please re-upload this file to your WordPress installation.' ), $config_sample ) );
</span><span class="cx">
</span><span class="cx">         $wp_config_file = file( $config_sample );
</span><span class="lines">@@ -209,35 +239,35 @@
</span><span class="cx">                         <li><p><?php _e( 'Replace the contents of your <code>wp-config.php</code> with the following:' ); ?></p>
</span><span class="cx">                                 <textarea name="wp-config" cols="120" rows="20">
</span><span class="cx"> <?php
</span><del>-        foreach ($wp_config_file as $line) {
-                switch ( trim( substr($line,0,16) ) ) {
</del><ins>+        foreach ( $wp_config_file as $line ) {
+                switch ( trim( substr( $line, 0, 16 ) ) ) {
</ins><span class="cx">                         case "define('DB_NAME'":
</span><del>-                                $output = str_replace("wordpress", DB_NAME, $line);
</del><ins>+                                $output = str_replace( "wordpress", DB_NAME, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('DB_USER'":
</span><del>-                                $output = str_replace("username", DB_USER, $line);
</del><ins>+                                $output = str_replace( "username", DB_USER, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('DB_PASSW":
</span><del>-                                $output = str_replace("password", DB_PASSWORD, $line);
</del><ins>+                                $output = str_replace( "password", DB_PASSWORD, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('DB_HOST'":
</span><del>-                                $output = str_replace("localhost", DB_HOST, $line);
</del><ins>+                                $output = str_replace( "localhost", DB_HOST, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('VHOST',":
</span><del>-                                $output = str_replace("VHOSTSETTING", $vhost, $line);
</del><ins>+                                $output = str_replace( "VHOSTSETTING", $vhost, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case '$table_prefix =':
</span><del>-                                $output = str_replace('wp_', $prefix, $line);
</del><ins>+                                $output = str_replace( 'wp_', $prefix, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case '$base = \'BASE\';':
</span><del>-                                $output = str_replace('BASE', $base, $line);
</del><ins>+                                $output = str_replace( 'BASE', $base, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('DOMAIN_C":
</span><span class="cx">                                 $domain = get_clean_basedomain();
</span><del>-                                $output = str_replace("current_site_domain", $domain, $line);
</del><ins>+                                $output = str_replace( "current_site_domain", $domain, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('PATH_CUR":
</span><del>-                                $output = str_replace("current_site_path", $base, $line);
</del><ins>+                                $output = str_replace( "current_site_path", $base, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "define('AUTH_KEY":
</span><span class="cx">                         case "define('AUTH_SAL":
</span><span class="lines">@@ -249,7 +279,7 @@
</span><span class="cx">                                         $hash = constant( $constant );
</span><span class="cx">                                 else
</span><span class="cx">                                         $hash = md5( mt_rand() ) . md5( mt_rand() );
</span><del>-                                $output = str_replace('put your unique phrase here', $hash, $line);
</del><ins>+                                $output = str_replace( 'put your unique phrase here', $hash, $line );
</ins><span class="cx">                                 break;
</span><span class="cx">                         default:
</span><span class="cx">                                 $output = $line;
</span><span class="lines">@@ -263,39 +293,45 @@
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Gets base domain of network.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> function get_clean_basedomain() {
</span><span class="cx">         global $wpdb;
</span><del>-        $domain = preg_replace( '|https?://|', '', get_option( 'siteurl') );
-        if( strpos( $domain, '/' ) )
</del><ins>+        $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
+        if ( strpos( $domain, '/' ) )
</ins><span class="cx">                 $domain = substr( $domain, 0, strpos( $domain, '/' ) );
</span><span class="cx">         return $domain;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-$action = isset($_POST[ 'action' ]) ? $_POST[ 'action' ] : null;
-switch($action) {
-        case "step2":
</del><ins>+$action = isset( $_POST[ 'action' ] ) ? $_POST[ 'action' ] : null;
+
+switch( $action ) {
+        case 'step2':
</ins><span class="cx">                 check_admin_referer( 'install-network-1' );
</span><span class="cx">
</span><span class="cx">                 // Install!
</span><del>-                $base = stripslashes( dirname( dirname($_SERVER["SCRIPT_NAME"]) ) );
-                if( $base != "/")
-                        $base .= "/";
</del><ins>+                $base = stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) );
+                if ( $base != '/' )
+                        $base .= '/';
</ins><span class="cx">
</span><span class="cx">                 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
</span><span class="cx">                 // create network tables
</span><span class="cx">                 $domain = get_clean_basedomain();
</span><span class="cx">                 install_network();
</span><del>-                populate_network( 1, $domain, sanitize_email( $_POST[ 'email' ] ), $_POST[ 'weblog_title' ], $base, $_POST[ 'vhost' ] );
</del><ins>+                populate_network( 1, $domain, sanitize_email( $_POST['email'] ), $_POST['weblog_title'], $base, $_POST['vhost'] );
</ins><span class="cx">                 // create wp-config.php / htaccess
</span><span class="cx">                 step2();
</span><span class="cx">         break;
</span><span class="cx">         default:
</span><span class="cx">                 //@todo: give an informative screen instead
</span><span class="cx">                 if ( is_multisite() ) {
</span><del>-                        _e('Network already enabled');
</del><ins>+                        _e( 'Network already enabled.' );
</ins><span class="cx">                 } else {
</span><span class="cx">                         $rewrite_enabled = step1();
</span><del>-                        printstep1form($rewrite_enabled);
</del><ins>+                        printstep1form( $rewrite_enabled );
</ins><span class="cx">                 }
</span><span class="cx">         break;
</span><span class="cx"> }
</span><span class="lines">@@ -303,4 +339,4 @@
</span><span class="cx"> </form>
</span><span class="cx"> </div>
</span><span class="cx">
</span><del>-<?php include('./admin-footer.php'); ?>
</del><ins>+<?php include( './admin-footer.php' ); ?>
</ins></span></pre>
</div>
</div>
</body>
</html>