Make WordPress Core

Changeset 12632


Ignore:
Timestamp:
01/07/2010 04:27:46 AM (15 years ago)
Author:
ryan
Message:

Strip trailing whites from ms files. see #11644

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r12625 r12632  
    4848
    4949    if ( $drop ) {
    50         $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A); 
    51         $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables ); 
     50        $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A);
     51        $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables );
    5252
    5353        reset( $drop_tables );
     
    220220    );
    221221    update_option( 'adminhash', $new_admin_email );
    222    
     222
    223223    $content = apply_filters( 'new_admin_email_content', __("Dear user,
    224224
    225 You recently requested to have the administration email address on 
     225You recently requested to have the administration email address on
    226226your blog changed.
    227227If this is correct, please click on the following link to change it:
     
    236236All at ###SITENAME###
    237237###SITEURL###"), $new_admin_email );
    238    
     238
    239239    $content = str_replace('###ADMIN_URL###', clean_url(get_option( "siteurl" ).'/wp-admin/options.php?adminhash='.$hash), $content);
    240240    $content = str_replace('###EMAIL###', $value, $content);
    241241    $content = str_replace('###SITENAME###', get_site_option( 'site_name' ), $content);
    242242    $content = str_replace('###SITEURL###', 'http://' . $current_site->domain . $current_site->path, $content);
    243    
     243
    244244    wp_mail( $value, sprintf(__('[%s] New Admin Email Address'), get_option('blogname')), $content );
    245245}
     
    355355function get_space_allowed() {
    356356    $spaceAllowed = get_option("blog_upload_space");
    357     if( $spaceAllowed == false ) 
     357    if( $spaceAllowed == false )
    358358        $spaceAllowed = get_site_option("blog_upload_space");
    359359    if( empty($spaceAllowed) || !is_numeric($spaceAllowed) )
     
    377377    }
    378378    ?>
    379     <strong><?php printf(__('Used: %1s%% of %2s'), number_format($percentused), $space );?></strong> 
     379    <strong><?php printf(__('Used: %1s%% of %2s'), number_format($percentused), $space );?></strong>
    380380    <?php
    381381}
    382382
    383383// Display File upload quota on dashboard
    384 function dashboard_quota() {   
     384function dashboard_quota() {
    385385    if ( get_site_option( 'upload_space_check_disabled' ) ) {
    386386        return true;
     
    413413// Edit blog upload space setting on Edit Blog page
    414414function upload_space_setting( $id ) {
    415     $quota = get_blog_option($id, "blog_upload_space"); 
     415    $quota = get_blog_option($id, "blog_upload_space");
    416416    if( !$quota )
    417417        $quota = '';
    418    
     418
    419419    ?>
    420420    <tr>
     
    433433    if( $refresh == 1 )
    434434        refresh_user_details($id);
    435    
     435
    436436    if( $pref == 'spam' ) {
    437         if( $value == 1 ) 
     437        if( $value == 1 )
    438438            do_action( "make_spam_user", $id );
    439439        else
     
    446446function refresh_user_details($id) {
    447447    $id = (int) $id;
    448    
     448
    449449    if ( !$user = get_userdata( $id ) )
    450450        return false;
     
    465465
    466466    $dirName = trailingslashit( BLOGUPLOADDIR );
    467     if (!(is_dir($dirName) && is_readable($dirName))) 
    468         return; 
     467    if (!(is_dir($dirName) && is_readable($dirName)))
     468        return;
    469469
    470470    $dir = dir($dirName);
     
    513513    if ( isset( $_GET[ 'c' ] ) )
    514514        $c = (int)$_GET[ 'c' ];
    515    
     515
    516516    if ( $c >= 5 ) {
    517517        wp_die( __( "You don&#8217;t have permission to view this blog. Please contact the system administrator." ) );
     
    522522    $dashboard_blog = get_dashboard_blog();
    523523    if( is_object( $blog ) ) {
    524         $protocol = ( is_ssl() ? 'https://' : 'http://' ); 
     524        $protocol = ( is_ssl() ? 'https://' : 'http://' );
    525525        wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
    526526        exit;
    527527    }
    528528
    529     /* 
    530        If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, 
     529    /*
     530       If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog,
    531531       then update the primary_blog record to match the user's blog
    532532     */
     
    541541        }
    542542        $blog = get_blog_details( get_usermeta( $current_user->ID , 'primary_blog' ) );
    543         $protocol = ( is_ssl() ? 'https://' : 'http://' ); 
     543        $protocol = ( is_ssl() ? 'https://' : 'http://' );
    544544        wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
    545545        exit;
     
    559559        $writing = array( 'ping_sites', 'mailserver_login', 'mailserver_pass', 'default_email_category', 'mailserver_port', 'mailserver_url' );
    560560    }
    561     $removed = array( 
     561    $removed = array(
    562562        'general' => array( 'siteurl', 'home', 'admin_email', 'users_can_register', 'default_role' ),
    563563        'reading' => array( 'gzipcompression' ),
     
    585585
    586586function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
    587     $flag = false; 
     587    $flag = false;
    588588    $output = array();
    589                    
     589
    590590    foreach ( (array) $lang_files as $val ) {
    591591        $code_lang = basename( $val, '.mo' );
    592        
     592
    593593        if ( $code_lang == 'en_US' ) { // American English
    594594            $flag = true;
     
    603603            $output[$translated] =  '<option value="'.$code_lang.'"'.(($current == $code_lang) ? ' selected="selected"' : '').'> '.$translated.'</option>';
    604604        }
    605        
    606     }                       
    607    
     605
     606    }
     607
    608608    if ( $flag === false ) { // WordPress english
    609609        $output[] = '<option value=""'.((empty($current)) ? ' selected="selected"' : '').'>'.__('English')."</option>";
    610610    }
    611    
     611
    612612    // Order by name
    613613    uksort($output, 'strnatcasecmp');
    614    
    615     $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current);   
    616     echo implode("\n\t", $output); 
     614
     615    $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current);
     616    echo implode("\n\t", $output);
    617617}
    618618
     
    763763    if ( !isset( $_GET['sitewide'] ) )
    764764        return false;
    765        
     765
    766766    /* Add the plugin to the list of sitewide active plugins */
    767767    $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
    768    
     768
    769769    /* Add the activated plugin to the list */
    770770    $active_sitewide_plugins[ $_GET['plugin'] ] = time();
     
    776776    return true;
    777777}
    778 add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); 
     778add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' );
    779779
    780780/**
     
    786786    if ( !$plugin )
    787787        $plugin = $_GET['plugin'];
    788        
     788
    789789    /* Get the active sitewide plugins */
    790790    $active_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
     
    798798    if ( !update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ) )
    799799        wp_redirect( 'plugins.php?error=true' );
    800    
     800
    801801    return true;
    802802}
    803 add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' ); 
    804 add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); 
     803add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' );
     804add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' );
    805805
    806806/**
     
    812812    if ( !is_site_admin() )
    813813        return false;
    814    
     814
    815815    if ( 'sitewide-active' == $context )
    816816        return false;
    817    
     817
    818818    if ( is_plugin_active( $file ) )
    819819        return false;
    820        
     820
    821821    echo '<tr><td colspan="5" style="background: #f5f5f5; text-align: right;">';
    822822
     
    835835    /* Open the plugin file for reading to check if this is a ms-plugin. */
    836836    $fp = @fopen( WP_PLUGIN_DIR . '/' . $file, 'r' );
    837    
     837
    838838    /* Pull only the first 8kiB of the file in. */
    839839    $plugin_data = @fread( $fp, 8192 );
    840    
     840
    841841    /* PHP will close file handle, but we are good citizens. */
    842842    @fclose($fp);
    843    
     843
    844844    if ( preg_match( '|Site Wide Only:(.*)true$|mi', $plugin_data ) )
    845845        return true;
     
    859859    if ( !is_site_admin() )
    860860        return false;
    861        
     861
    862862    $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins') );
    863863    $context = 'sitewide-active';
    864864
    865     if ( $active_sitewide_plugins ) { 
     865    if ( $active_sitewide_plugins ) {
    866866?>
    867867        <h3><?php _e( 'Currently Active Site Wide Plugins' ) ?></h3>
    868    
     868
    869869        <p><?php _e( 'Plugins that appear in the list below are activate for all blogs across this installation.' ) ?></p>
    870870
     
    899899
    900900                $plugin_data = $all_plugins[$plugin_file];
    901                
     901
    902902                echo "
    903903            <tr class='$context' style='background: #eef2ff;'>
     
    932932                echo "</td>
    933933            </tr>\n";
    934            
     934
    935935                do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context );
    936936                do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context );
     
    939939            </tbody>
    940940        </table>
    941        
     941
    942942        <p><?php _e( 'Plugins that are enabled site wide can only be disabled by a site administrator.' ) ?></p>
    943        
     943
    944944<?php
    945945    }
     
    960960    }
    961961
    962     /* Now unset any sitewide only plugins if the user is not a site admin */   
     962    /* Now unset any sitewide only plugins if the user is not a site admin */
    963963    if ( !is_site_admin() ) {
    964964        foreach ( $inactive_plugins as $plugin_name => $activated_time ) {
     
    967967        }
    968968    }
    969    
     969
    970970    return $inactive_plugins;
    971971}
     
    984984        unset( $active_plugins[ $sitewide_plugin ] );
    985985    }
    986    
     986
    987987    return $active_plugins;
    988988}
     
    997997function check_is_wpmu_plugin_on_activate() {
    998998    /***
    999      * On plugin activation on a blog level, check to see if this is actually a 
     999     * On plugin activation on a blog level, check to see if this is actually a
    10001000     * site wide MU plugin. If so, deactivate and activate it site wide.
    10011001     */
    10021002    if ( is_wpmu_sitewide_plugin( $_GET['plugin'] ) || isset( $_GET['sitewide'] ) ) {
    10031003        deactivate_plugins( $_GET['plugin'], true );
    1004        
     1004
    10051005        /* Silently activate because the activate_* hook has already run. */
    10061006        if ( is_site_admin() ) {
     
    10231023                if ( is_site_admin() )
    10241024                    activate_sitewide_plugin( $plugin );
    1025             }           
     1025            }
    10261026        }
    10271027    }
     
    10511051            ?>
    10521052            <select name="primary_blog">
    1053                 <?php foreach( (array) $all_blogs as $blog ) { 
     1053                <?php foreach( (array) $all_blogs as $blog ) {
    10541054                    if( $primary_blog == $blog->userblog_id )
    10551055                        $found = true;
    1056                     ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php 
     1056                    ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php
    10571057                } ?>
    10581058            </select>
     
    10741074    </tr>
    10751075    </table>
    1076     <?php   
     1076    <?php
    10771077}
    10781078add_action ( 'myblogs_allblogs_options', 'choose_primary_blog' );
     
    11451145    <?php
    11461146    do_action( 'myblogs_allblogs_options' );
    1147     ?><table class='widefat'> <?php 
     1147    ?><table class='widefat'> <?php
    11481148    $settings_html = apply_filters( 'myblogs_options', '', 'global' );
    11491149    if ( $settings_html != '' ) {
     
    11661166        $split = $split + $cols;
    11671167    }
    1168  
     1168
    11691169    foreach( $rows as $row ) {
    11701170        $c = $c == "alternate" ? "" : "alternate";
     
    12171217            foreach( $rows as $row ) {
    12181218                $value = $row->meta_value;
    1219                 if ( !@unserialize( $value ) ) 
    1220                     $value = stripslashes( $value ); 
     1219                if ( !@unserialize( $value ) )
     1220                    $value = stripslashes( $value );
    12211221                if ( $value !== $row->meta_value ) {
    12221222                    update_site_option( $row->meta_key, $value );
     
    12311231        foreach( $rows as $row ) {
    12321232            $value = $row->option_value;
    1233             if ( !@unserialize( $value ) ) 
    1234                 $value = stripslashes( $value ); 
     1233            if ( !@unserialize( $value ) )
     1234                $value = stripslashes( $value );
    12351235            if ( $value !== $row->option_value ) {
    12361236                update_blog_option( $blog_id, $row->option_name, $value );
  • trunk/wp-admin/ms-admin.php

    r12628 r12632  
    3131
    3232<div class="wrap">
    33     <h2><?php echo wp_specialchars( $title ); ?></h2> 
     33    <h2><?php echo wp_specialchars( $title ); ?></h2>
    3434
    3535    <ul class="subsubsub">
     
    4545        <p>
    4646            <input type="hidden" name="action" value="users" />
    47             <input type="text" name="s" value="" size="17" /> 
     47            <input type="text" name="s" value="" size="17" />
    4848            <input class="button" type="submit" name="submit" value="<?php esc_attr_e("Search Users"); ?>" />
    49         </p> 
     49        </p>
    5050    </form>
    5151
  • trunk/wp-admin/ms-edit.php

    r12624 r12632  
    1111do_action('wpmuadminedit', '');
    1212
    13 if( isset($_GET[ 'id' ]) ) { 
    14     $id = intval( $_GET[ 'id' ] ); 
    15 } elseif( isset($_POST[ 'id' ]) ) { 
    16     $id = intval( $_POST[ 'id' ] ); 
     13if( isset($_GET[ 'id' ]) ) {
     14    $id = intval( $_GET[ 'id' ] );
     15} elseif( isset($_POST[ 'id' ]) ) {
     16    $id = intval( $_POST[ 'id' ] );
    1717}
    1818
     
    144144        if ( empty($domain) || empty($email))
    145145            wp_die( __('Missing blog address or email address.') );
    146         if( !is_email( $email ) ) 
    147             wp_die( __('Invalid email address') ); 
     146        if( !is_email( $email ) )
     147            wp_die( __('Invalid email address') );
    148148
    149149        if( constant( 'VHOST' ) == 'yes' ) {
     
    219219                update_option( 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] );
    220220        }
    221            
     221
    222222        $wp_rewrite->flush_rules();
    223223
     
    318318                    $blogfunction = 'all_spam';
    319319                    update_blog_status( $val, "spam", '1', 0 );
    320                     set_time_limit(60); 
     320                    set_time_limit(60);
    321321                } elseif ( isset($_POST['allblog_notspam']) ) {
    322322                    $blogfunction = 'all_notspam';
    323323                    update_blog_status( $val, "spam", '0', 0 );
    324                     set_time_limit(60); 
     324                    set_time_limit(60);
    325325                }
    326326            }
     
    432432                    <?php wp_nonce_field( $_GET['action2'] ) ?>
    433433                    <p><?php echo wp_specialchars( stripslashes($_GET['msg']) ); ?></p>
    434                     <p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p>                       
     434                    <p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p>
    435435                </form>
    436436            </body>
  • trunk/wp-admin/ms-options.php

    r12627 r12632  
    281281            <?php
    282282            $menu_perms = get_site_option( "menu_items" );
    283             $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) );         
     283            $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) );
    284284            foreach ( (array) $menu_items as $key => $val ) {
    285285                echo "<tr><th scope='row'>" . wp_specialchars($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . (( $menu_perms[$key] == '1' ) ? ' checked="checked"' : '') . " /></td></tr>";
  • trunk/wp-admin/ms-sites.php

    r12629 r12632  
    8282        <form method="post" action="ms-edit.php?action=updateblog">
    8383            <?php wp_nonce_field('editblog'); ?>
    84             <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" /> 
     84            <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
    8585            <div class='metabox-holder' style='width:49%;float:left;'>
    8686            <div id="blogedit_bloginfo" class="postbox " >
     
    8989                <table class="form-table">
    9090                            <tr class="form-field form-required">
    91                                 <th scope="row"><?php _e('Domain') ?></th> 
     91                                <th scope="row"><?php _e('Domain') ?></th>
    9292                                <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td>
    93                             </tr> 
     93                            </tr>
    9494                            <tr class="form-field form-required">
    95                                 <th scope="row"><?php _e('Path') ?></th> 
     95                                <th scope="row"><?php _e('Path') ?></th>
    9696                                <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details['path']) ?>" size="40" style='margin-bottom:5px;' />
    9797                                <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
    98                             </tr> 
     98                            </tr>
    9999                            <tr class="form-field">
    100                                 <th scope="row"><?php _e('Registered') ?></th> 
    101                                 <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td> 
    102                             </tr> 
     100                                <th scope="row"><?php _e('Registered') ?></th>
     101                                <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td>
     102                            </tr>
    103103                            <tr class="form-field">
    104                                 <th scope="row"><?php _e('Last Updated') ?></th> 
    105                                 <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td> 
    106                             </tr> 
     104                                <th scope="row"><?php _e('Last Updated') ?></th>
     105                                <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td>
     106                            </tr>
    107107                            <tr class="form-field">
    108                                 <th scope="row"><?php _e('Public') ?></th> 
     108                                <th scope="row"><?php _e('Public') ?></th>
    109109                                <td>
    110110                                    <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    111111                                    <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    112                                 </td> 
    113                             </tr> 
     112                                </td>
     113                            </tr>
    114114                            <tr class="form-field">
    115                                 <th scope="row"><?php _e( 'Archived' ); ?></th> 
     115                                <th scope="row"><?php _e( 'Archived' ); ?></th>
    116116                                <td>
    117117                                    <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    118118                                    <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    119                                 </td> 
    120                             </tr> 
     119                                </td>
     120                            </tr>
    121121                            <tr class="form-field">
    122                                 <th scope="row"><?php _e( 'Mature' ); ?></th> 
     122                                <th scope="row"><?php _e( 'Mature' ); ?></th>
    123123                                <td>
    124124                                    <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    125125                                    <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    126                                 </td> 
    127                             </tr> 
     126                                </td>
     127                            </tr>
    128128                            <tr class="form-field">
    129                                 <th scope="row"><?php _e( 'Spam' ); ?></th> 
     129                                <th scope="row"><?php _e( 'Spam' ); ?></th>
    130130                                <td>
    131131                                    <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    132132                                    <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    133                                 </td> 
    134                             </tr> 
     133                                </td>
     134                            </tr>
    135135                            <tr class="form-field">
    136                                 <th scope="row"><?php _e( 'Deleted' ); ?></th> 
     136                                <th scope="row"><?php _e( 'Deleted' ); ?></th>
    137137                                <td>
    138138                                    <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    139139                                    <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    140                                 </td> 
    141                             </tr> 
     140                                </td>
     141                            </tr>
    142142                        </table>
    143143                        <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
    144144            </div></div>
    145            
     145
    146146            <div id="blogedit_blogoptions" class="postbox " >
    147147            <h3 class='hndle'><span><?php printf( __('Blog options (wp_%s_options)'), $id ); ?></span></h3>
     
    166166                                ?>
    167167                                    <tr class="form-field">
    168                                         <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th> 
     168                                        <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
    169169                                        <td><textarea rows="5" cols="40" name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>"<?php echo $disabled ?>><?php echo wp_specialchars( stripslashes( $val['option_value'] ), 1 ) ?></textarea></td>
    170170                                    </tr>
     
    173173                                ?>
    174174                                    <tr class="form-field">
    175                                         <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th> 
    176                                         <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td> 
    177                                     </tr> 
     175                                        <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
     176                                        <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td>
     177                                    </tr>
    178178                                <?php
    179179                                }
     
    184184            </div></div>
    185185            </div>
    186            
     186
    187187            <div class='metabox-holder' style='width:49%;float:right;'>
    188188            <?php
     
    200200                            $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : '';
    201201                            $out .= '<tr class="form-field form-required">
    202                                     <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th> 
    203                                     <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td> 
     202                                    <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th>
     203                                    <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td>
    204204                                </tr>';
    205205                        }
    206206                    }
    207                    
     207
    208208                    if ( $out != '' ) {
    209209            ?>
     
    218218            </div></div>
    219219            <?php } ?>
    220            
     220
    221221            <?php
    222222                    // Blog users
     
    237237                                ?>
    238238                                <td>
    239                                     <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php 
     239                                    <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php
    240240                                        foreach( $editblog_roles as $role => $role_assoc ){
    241241                                            $name = translate_with_context($role_assoc['name']);
     
    261261                    }
    262262            ?>
    263            
     263
    264264            <div id="blogedit_blogadduser" class="postbox">
    265265            <h3 class='hndle'><span><?php _e('Add a new user'); ?></span></h3>
     
    275275                            <td>
    276276                                <select name="new_role" id="new_role">
    277                                 <?php 
     277                                <?php
    278278                                reset( $editblog_roles );
    279279                                foreach( $editblog_roles as $role => $role_assoc ){
     
    289289                <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
    290290            </div></div>
    291            
     291
    292292            <div id="blogedit_miscoptions" class="postbox">
    293293            <h3 class='hndle'><span><?php _e('Misc Blog Actions') ?></span></h3>
     
    298298                <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
    299299            </div></div>
    300            
     300
    301301            </div>
    302            
     302
    303303            <div style="clear:both;"></div>
    304304        </form>
     
    325325                AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
    326326                AND {$wpdb->registration_log}.IP LIKE ('%{$s}%')";
    327         } 
     327        }
    328328
    329329        if( isset( $_GET['sortby'] ) == false ) {
     
    408408            'users'        => __('Users')
    409409        );
    410        
     410
    411411        if( has_filter( 'wpmublogsaction' ) )
    412412            $posts_columns['plugins'] = __('Actions');
    413            
     413
    414414        $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns);
    415415
     
    428428                <?php foreach($posts_columns as $column_id => $column_display_name) {
    429429                    $column_link = "<a href='ms-blogs.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
    430                     if( $_GET['sortby'] == $column_id ) { 
     430                    if( $_GET['sortby'] == $column_id ) {
    431431                        $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&amp;' : 'order=DESC&amp;';
    432432                    }
     
    444444                $bgcolor = $class = '';
    445445                $status_list = array( "archived" => "#fee", "spam" => "#faa", "deleted" => "#f55" );
    446                 foreach ($blog_list as $blog) { 
     446                foreach ($blog_list as $blog) {
    447447                    $class = ('alternate' == $class) ? '' : 'alternate';
    448448                    reset( $status_list );
     
    456456                    echo "<tr $bgcolour class='$class'>";
    457457
    458                     $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; 
     458                    $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path'];
    459459                    foreach( $posts_columns as $column_name=>$column_display_name ) {
    460460                        switch($column_name) {
     
    468468                            <?php
    469469                            break;
    470  
     470
    471471                            case 'blogname': ?>
    472472                                <td valign="top">
     
    477477                                    $controlActions[]   = '<a href="ms-blogs.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
    478478                                    $controlActions[]   = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>';
    479                                    
     479
    480480                                    if( get_blog_status( $blog['blog_id'], "deleted" ) == '1' )
    481481                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>';
    482482                                    else
    483483                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>';
    484                                    
     484
    485485                                    if( get_blog_status( $blog['blog_id'], "archived" ) == '1' )
    486486                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>';
    487487                                    else
    488488                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>';
    489                                    
     489
    490490                                    if( get_blog_status( $blog['blog_id'], "spam" ) == '1' )
    491491                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>';
    492492                                    else
    493493                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the blog %s as spam" ), $blogname ) ) . '">' . __("Spam") . '</a>';
    494                                    
     494
    495495                                    $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) . '">' . __("Delete") . '</a>';
    496                                    
     496
    497497                                    $controlActions[]   = "<a href='http://{$blog['domain']}{$blog['path']}' rel='permalink'>" . __('Visit') . '</a>';
    498498                                    ?>
    499                                    
     499
    500500                                    <?php if (count($controlActions)) : ?>
    501501                                    <div class="row-actions">
     
    506506                            <?php
    507507                            break;
    508  
     508
    509509                            case 'lastupdated': ?>
    510510                                <td valign="top">
     
    523523                                <td valign="top">
    524524                                    <?php
    525                                     $blogusers = get_users_of_blog( $blog['blog_id'] ); 
     525                                    $blogusers = get_users_of_blog( $blog['blog_id'] );
    526526                                    if ( is_array( $blogusers ) ) {
    527527                                        $blogusers_warning = '';
     
    531531                                        }
    532532                                        foreach ( $blogusers as $key => $val ) {
    533                                             echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />'; 
     533                                            echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />';
    534534                                        }
    535535                                        if( $blogusers_warning != '' ) {
     
    549549                                <?php } ?>
    550550                            <?php break;
    551  
     551
    552552                            default: ?>
    553553                                <?php if( has_filter( 'manage_blogs_custom_column' ) ) { ?>
     
    564564                }
    565565            } else { ?>
    566                 <tr style='background-color: <?php echo $bgcolor; ?>'> 
    567                     <td colspan="8"><?php _e('No blogs found.') ?></td> 
    568                 </tr> 
     566                <tr style='background-color: <?php echo $bgcolor; ?>'>
     567                    <td colspan="8"><?php _e('No blogs found.') ?></td>
     568                </tr>
    569569            <?php
    570570            } // end if ($blogs)
     
    586586                        <td>
    587587                        <?php if ( constant( "VHOST" ) == 'yes' ) { ?>
    588                             <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?> 
     588                            <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
    589589                        <?php } else {
    590590                            echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>
    591                         <?php } 
     591                        <?php }
    592592                        echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>";
    593593                        ?>
  • trunk/wp-admin/ms-upgrade-site.php

    r12627 r12632  
    3838                    }
    3939                    do_action( 'after_mu_upgrade', $response );
    40                     do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] ); 
     40                    do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
    4141                }
    4242            }
     
    5555        }
    5656    break;
    57     default: 
     57    default:
    5858        ?><p><?php _e("You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade."); ?></p>
    5959        <p><a class="button" href="ms-upgrade-site.php?action=upgrade"><?php _e("Upgrade Site"); ?></a></p><?php
  • trunk/wp-admin/ms-users.php

    r12627 r12632  
    2727                _e('Users marked as spam !');
    2828            break;
    29             case 'all_notspam': 
    30                 _e('Users marked as not spam !'); 
    31             break; 
     29            case 'all_notspam':
     30                _e('Users marked as not spam !');
     31            break;
    3232            case 'all_delete':
    3333                _e('Users deleted !');
     
    8686    // Pagination
    8787    $user_navigation = paginate_links( array(
    88         'total' => ceil($total / $num), 
     88        'total' => ceil($total / $num),
    8989        'current' => $apage,
    9090        'base' => add_query_arg( 'apage', '%#%' ),
    9191        'format' => ''
    9292    ));
    93    
     93
    9494    if ( $user_navigation ) {
    9595        $user_navigation = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
     
    100100        );
    101101    }
    102    
     102
    103103    ?>
    104104    <div class="wrap">
     
    158158            <?php if ($user_list) {
    159159                $bgcolor = '';
    160                 foreach ( (array) $user_list as $user) { 
     160                foreach ( (array) $user_list as $user) {
    161161                    $class = ('alternate' == $class) ? '' : 'alternate';
    162                    
     162
    163163                    $status_list = array( "spam" => "#faa", "deleted" => "#f55" );
    164                    
     164
    165165                    $bgcolour = "";
    166166                    foreach ( $status_list as $status => $col ) {
     
    178178                            case 'checkbox': ?>
    179179                                <th scope="row" class="check-column"><input type='checkbox' id='user_<?php echo $user['ID'] ?>' name='allusers[]' value='<?php echo esc_attr($user['ID']) ?>' /></th>
    180                             <?php 
     180                            <?php
    181181                            break;
    182182
     
    213213                            break;
    214214
    215                             case 'blogs': 
     215                            case 'blogs':
    216216                                $blogs = get_blogs_of_user( $user['ID'], true );
    217217                                ?>
     
    223223                                            echo '<a href="ms-blogs.php?action=editblog&amp;id=' . $val->userblog_id . '">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
    224224                                            echo ' <small class="row-actions">';
    225                                            
     225
    226226                                            // Edit
    227227                                            echo '<a href="ms-blogs.php?action=editblog&amp;id=' . $val->userblog_id . '">' . __('Edit') . '</a> | ';
    228                                            
     228
    229229                                            // View
    230                                             echo '<a '; 
     230                                            echo '<a ';
    231231                                            if( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
    232232                                                echo 'style="background-color: #f66" ';
    233233                                            echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . '</a>';
    234                                            
    235                                             echo '</small><br />'; 
     234
     235                                            echo '</small><br />';
    236236                                        }
    237237                                    }
     
    248248                    endforeach
    249249                    ?>
    250                     </tr> 
     250                    </tr>
    251251                    <?php
    252252                }
    253253            } else {
    254254            ?>
    255                 <tr style='background-color: <?php echo $bgcolor; ?>'> 
    256                     <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td> 
    257                 </tr> 
     255                <tr style='background-color: <?php echo $bgcolor; ?>'>
     256                    <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td>
     257                </tr>
    258258                <?php
    259259            } // end if ($users)
    260             ?> 
     260            ?>
    261261            </tbody>
    262262        </table>
    263        
     263
    264264        <div class="tablenav">
    265265            <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?>
  • trunk/wp-includes/ms-functions.php

    r12628 r12632  
    7878function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
    7979    global $wpdb;
    80    
     80
    8181    if( $sitedomain == '' ) {
    8282        $site_id = $wpdb->siteid;
     
    188188 *
    189189 * @deprecated Use {@link is_keymaster()}
    190  * 
     190 *
    191191 */
    192192function is_site_admin( $user_login = '' ) {
     
    270270function add_blog_option( $id, $key, $value ) {
    271271    $id = (int) $id;
    272    
     272
    273273    switch_to_blog($id);
    274274    add_option( $key, $value );
     
    279279function delete_blog_option( $id, $key ) {
    280280    $id = (int) $id;
    281    
     281
    282282    switch_to_blog($id);
    283283    delete_option( $key );
     
    288288function update_blog_option( $id, $key, $value, $refresh = true ) {
    289289    $id = (int) $id;
    290    
     290
    291291    switch_to_blog($id);
    292292    update_option( $key, $value );
     
    309309    $switched_stack[] = $blog_id;
    310310
    311     /* If we're switching to the same blog id that we're on, 
    312     * set the right vars, do the associated actions, but skip 
     311    /* If we're switching to the same blog id that we're on,
     312    * set the right vars, do the associated actions, but skip
    313313    * the extra unnecessary work */
    314314    if ( $blog_id == $new_blog ) {
     
    408408    do_action('switch_blog', $blog_id, $prev_blog_id);
    409409
    410     /* If we still have items in the switched stack, consider ourselves still 'switched' */ 
     410    /* If we still have items in the switched stack, consider ourselves still 'switched' */
    411411    $switched = ( is_array( $switched_stack ) && count( $switched_stack ) > 0 );
    412412    return true;
     
    512512    $user_id = (int) $user_id;
    513513    $blog_id = (int) $blog_id;
    514    
     514
    515515    if( $blog_id == 0 ) {
    516516        global $wpdb;
    517517        $blog_id = $wpdb->blogid;
    518518    }
    519    
     519
    520520    $blogs = get_blogs_of_user( $user_id );
    521521    if( is_array( $blogs ) ) {
     
    907907function is_email_address_unsafe( $user_email ) {
    908908    $banned_names = get_site_option( "banned_email_domains" );
    909     if ($banned_names && !is_array( $banned_names )) { 
    910         $banned_names = explode( "\n", $banned_names); 
    911     } 
     909    if ($banned_names && !is_array( $banned_names )) {
     910        $banned_names = explode( "\n", $banned_names);
     911    }
    912912    if ( is_array( $banned_names ) && empty( $banned_names ) == false ) {
    913913        $email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
     
    11171117    $path = $wpdb->escape($path);
    11181118    $title = $wpdb->escape($title);
    1119                    
     1119
    11201120    $wpdb->insert( $wpdb->signups, array(
    1121         'domain' => $domain, 
    1122         'path' => $path, 
     1121        'domain' => $domain,
     1122        'path' => $path,
    11231123        'title' => $title,
    1124         'user_login' => $user, 
    1125         'user_email' => $user_email, 
     1124        'user_login' => $user,
     1125        'user_email' => $user_email,
    11261126        'registered' => current_time('mysql', true),
    1127         'activation_key' => $key, 
     1127        'activation_key' => $key,
    11281128        'meta' => $meta
    11291129    ) );
     
    11401140    $key = substr( md5( time() . rand() . $user_email ), 0, 16 );
    11411141    $meta = serialize($meta);
    1142                    
     1142
    11431143    $wpdb->insert( $wpdb->signups, array(
    1144         'domain' => '', 
    1145         'path' => '', 
     1144        'domain' => '',
     1145        'path' => '',
    11461146        'title' => '',
    1147         'user_login' => $user, 
    1148         'user_email' => $user_email, 
     1147        'user_login' => $user,
     1148        'user_email' => $user_email,
    11491149        'registered' => current_time('mysql', true),
    1150         'activation_key' => $key, 
     1150        'activation_key' => $key,
    11511151        'meta' => $meta
    11521152    ) );
     
    13441344    if( get_site_option( 'registrationnotification' ) != 'yes' )
    13451345        return false;
    1346        
     1346
    13471347    $email = get_site_option( 'admin_email' );
    13481348    if( is_email($email) == false )
    13491349        return false;
    1350    
     1350
    13511351    $options_site_url = clean_url("http://{$current_site->domain}{$current_site->path}wp-admin/ms-options.php");
    13521352
     
    13551355    $siteurl = get_option( 'siteurl' );
    13561356    restore_current_blog();
    1357    
     1357
    13581358    $msg = sprintf( __( "New Blog: %1s
    13591359URL: %2s
     
    13621362Disable these notifications: %4s"), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url);
    13631363    $msg = apply_filters( 'newblog_notify_siteadmin', $msg );
    1364    
     1364
    13651365    wp_mail( $email, sprintf( __( "New Blog Registration: %s" ), $siteurl ), $msg );
    13661366    return true;
     
    13711371    if( get_site_option( 'registrationnotification' ) != 'yes' )
    13721372        return false;
    1373        
     1373
    13741374    $email = get_site_option( 'admin_email' );
    13751375    if( is_email($email) == false )
     
    13821382
    13831383Disable these notifications: %3s"), $user->user_login, $_SERVER['REMOTE_ADDR'], $options_site_url);
    1384    
     1384
    13851385    $msg = apply_filters( 'newuser_notify_siteadmin', $msg );
    13861386    wp_mail( $email, sprintf(__("New User Registration: %s"), $user->user_login), $msg );
     
    14171417    require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
    14181418
    1419     if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) 
     1419    if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") )
    14201420        die(__('<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>') . '</body></html>');
    14211421    $wpdb->suppress_errors( false);
     
    14451445    $cat_name = __('Blogroll');
    14461446    $cat_slug = sanitize_title($cat_name);
    1447    
     1447
    14481448    $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
    14491449    if( $blogroll_id == null ) {
     
    14881488    $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );
    14891489    $wpdb->insert( $wpdb->posts, array(
    1490         'post_author' => $user_id, 
    1491         'post_date' => $now, 
     1490        'post_author' => $user_id,
     1491        'post_date' => $now,
    14921492        'post_date_gmt' => $now_gmt,
    1493         'post_content' => stripslashes( $first_post ), 
    1494         'post_excerpt' => '', 
     1493        'post_content' => stripslashes( $first_post ),
     1494        'post_excerpt' => '',
    14951495        'post_title' => __('Hello world!'),
    14961496        'post_name' => __('hello-world'),
     
    15071507    // First page
    15081508    $wpdb->insert( $wpdb->posts, array(
    1509         'post_author' => $user_id, 
    1510         'post_date' => $now, 
     1509        'post_author' => $user_id,
     1510        'post_date' => $now,
    15111511        'post_date_gmt' => $now_gmt,
    15121512        'post_content' => get_site_option( 'first_page' ),
    1513         'post_excerpt' => '', 
     1513        'post_excerpt' => '',
    15141514        'post_title' => __('About'),
    15151515        'post_name' => __('about'),
     
    15221522        'post_content_filtered' => ''
    15231523    ) );
    1524    
     1524
    15251525    // Flush rules to pick up the new page.
    15261526    $wp_rewrite->init();
     
    15291529    // Default comment
    15301530    $wpdb->insert( $wpdb->comments, array(
    1531         'comment_post_ID' => '1', 
     1531        'comment_post_ID' => '1',
    15321532        'comment_author' => __( get_site_option( 'first_comment_author' ) ),
    15331533        'comment_author_email' => '',
    15341534        'comment_author_url' => get_site_option( 'first_comment_url' ),
    1535         'comment_author_IP' => '127.0.0.1', 
     1535        'comment_author_IP' => '127.0.0.1',
    15361536        'comment_date' => $now,
    1537         'comment_date_gmt' => $now_gmt, 
     1537        'comment_date_gmt' => $now_gmt,
    15381538        'comment_content' => __( get_site_option( 'first_comment' ) )
    15391539    ) );
    1540    
     1540
    15411541    $user = new WP_User($user_id);
    15421542    $wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') );
     
    15451545    $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'user_level') );
    15461546    $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'capabilities') );
    1547    
     1547
    15481548    // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
    15491549    if ( !is_site_admin( $user->user_login ) && $user_id != 1 )
     
    16061606        return false;
    16071607
    1608     $welcome_email = get_site_option( 'welcome_user_email' ); 
     1608    $welcome_email = get_site_option( 'welcome_user_email' );
    16091609
    16101610    $user = new WP_User($user_id);
     
    17471747    $spaceAllowed = get_space_allowed();
    17481748    if(empty($spaceAllowed) || !is_numeric($spaceAllowed))
    1749         $spaceAllowed = 10; // Default space allowed is 10 MB 
    1750    
     1749        $spaceAllowed = 10; // Default space allowed is 10 MB
     1750
    17511751    $dirName = BLOGUPLOADDIR;
    17521752    $size = get_dirsize($dirName) / 1024 / 1024;
    1753    
    1754     if( ($spaceAllowed-$size) < 0 ) { 
     1753
     1754    if( ($spaceAllowed-$size) < 0 ) {
    17551755        if( $echo )
    17561756            _e( "Sorry, you have used your space allocation. Please delete some files to upload more files." ); //No space left
     
    17881788        return 0;
    17891789    }
    1790    
     1790
    17911791    $spaceAllowed = 1024 * 1024 * get_space_allowed();
    17921792    $dirName = BLOGUPLOADDIR;
     
    18021802function graceful_fail( $message ) {
    18031803    $message = apply_filters('graceful_fail', $message);
    1804     $message_template = apply_filters( 'graceful_fail_template', 
     1804    $message_template = apply_filters( 'graceful_fail_template',
    18051805'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    18061806<html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
     
    18441844
    18451845        if( $this->reallydeleteblog == true ) {
    1846             wpmu_delete_blog( $wpdb->blogid ); 
     1846            wpmu_delete_blog( $wpdb->blogid );
    18471847        }
    18481848    }
     
    18631863            $url_delete = get_option( "siteurl" ) . "/wp-admin/options-general.php?page=delete-blog&h=" . $hash;
    18641864            $msg = __("Dear User,
    1865 You recently clicked the 'Delete Blog' link on your blog and filled in a 
     1865You recently clicked the 'Delete Blog' link on your blog and filled in a
    18661866form on that page.
    18671867If you really want to delete your blog, click the link below. You will not
     
    18701870
    18711871If you delete your blog, please consider opening a new blog here
    1872 some time in the future! (But remember your current blog and username 
     1872some time in the future! (But remember your current blog and username
    18731873are gone forever.)
    18741874
     
    19331933    clean_term_cache($term_id);
    19341934
    1935     return $global_id; 
    1936 }   
     1935    return $global_id;
     1936}
    19371937
    19381938function redirect_this_site( $deprecated = '' ) {
     
    19451945        return $upload;
    19461946    if( strlen( $upload[ 'bits' ] )  > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) {
    1947         return sprintf(__( "This file is too big. Files must be less than %dKb in size.<br />" ), get_site_option( 'fileupload_maxk', 1500 )); 
     1947        return sprintf(__( "This file is too big. Files must be less than %dKb in size.<br />" ), get_site_option( 'fileupload_maxk', 1500 ));
    19481948    }
    19491949
     
    21132113}
    21142114
    2115 /* Short circuit the update checks. Make sure update informtion is 
     2115/* Short circuit the update checks. Make sure update informtion is
    21162116   stored in wp_sitemeta rather than the options table of individual blogs */
    21172117
     
    21982198
    21992199    $dashboard_blog = get_dashboard_blog();
    2200     if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) { 
    2201         $protocol = ( is_ssl() ? 'https://' : 'http://' ); 
     2200    if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) {
     2201        $protocol = ( is_ssl() ? 'https://' : 'http://' );
    22022202        wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' );
    22032203        die();
     
    22232223    if( $blog_id == 0 )
    22242224        $blog_id = $wpdb->blogid;
    2225    
     2225
    22262226    $local_key = $wpdb->base_prefix . $blog_id . "_" . $key;
    22272227    if( isset( $current_user->$local_key ) )
     
    23472347    if ( !$active_sitewide_plugins )
    23482348        return $active_plugins;
    2349    
     2349
    23502350    $plugins = array_merge( (array) $active_plugins, array_keys( (array) $active_sitewide_plugins ) );
    23512351    sort( $plugins );
  • trunk/wp-includes/ms-settings.php

    r12610 r12632  
    5454    if( $current_site )
    5555        return $current_site;
    56        
     56
    5757    $wpdb->suppress_errors();
    5858    $sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // usually only one site
Note: See TracChangeset for help on using the changeset viewer.