Make WordPress Core

Changeset 5700


Ignore:
Timestamp:
06/14/2007 02:25:30 AM (18 years ago)
Author:
ryan
Message:

Trim empty lines. Nothing but newline.

Location:
trunk
Files:
59 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-pages.php

    r5587 r5700  
    4242    </fieldset>
    4343
    44        
     44
    4545    <fieldset><legend><?php _e('Page Type&hellip;'); ?></legend>
    4646        <select name='post_status'>
  • trunk/wp-admin/export.php

    r5674 r5700  
    134134    another. This file is not intended to serve as a complete backup of your
    135135    blog.
    136    
     136
    137137    To import this information into a WordPress blog follow these steps:
    138    
     138
    139139    1.  Log into that blog as an administrator.
    140140    2.  Go to Manage > Import in the blog's admin.
  • trunk/wp-admin/import/blogger.php

    r5404 r5700  
    916916                array_push($this->in_content, ">");
    917917            }
    918          
     918
    919919            array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
    920920        } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
  • trunk/wp-admin/import/mt.php

    r5684 r5700  
    273273        $ping = new StdClass();
    274274        $pings = array();
    275        
     275
    276276        echo "<div class='wrap'><ol>";
    277277
  • trunk/wp-admin/import/utw.php

    r5390 r5700  
    22
    33class UTW_Import {
    4    
     4
    55    function header()  {
    66        echo '<div class="wrap">';
     
    2424        echo '</div>';
    2525    }
    26    
    27    
     26
     27
    2828    function dispatch () {
    2929        if ( empty( $_GET['step'] ) ) {
     
    3232            $step = (int) $_GET['step'];
    3333        }
    34        
     34
    3535        // load the header
    3636        $this->header();
    37        
     37
    3838        switch ( $step ) {
    3939            case 0 :
     
    5353                break;
    5454        }
    55        
     55
    5656        // load the footer
    5757        $this->footer();
    5858    }
    59    
    60    
     59
     60
    6161    function import_tags ( ) {
    6262        echo '<div class="narrow">';
    6363        echo '<p><h3>'.__('Reading UTW Tags&#8230;').'</h3></p>';
    64        
     64
    6565        $tags = $this->get_utw_tags();
    66        
     66
    6767        // if we didn't get any tags back, that's all there is folks!
    6868        if ( !is_array($tags) ) {
     
    7878
    7979            add_option('utwimp_tags', $tags);
    80            
     80
    8181
    8282            $count = count($tags);
    83            
     83
    8484            echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
    8585            echo '<p>' . __('The following tags were found:') . '</p>';
    86            
     86
    8787            echo '<ul>';
    88            
     88
    8989            foreach ( $tags as $tag_id => $tag_name ) {
    90                
     90
    9191                echo '<li>' . $tag_name . '</li>';
    92                
     92
    9393            }
    94            
     94
    9595            echo '</ul>';
    96            
     96
    9797            echo '<br />';
    98            
     98
    9999            echo '<p>' . __('If you don&#8217;t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>';
    100            
    101            
    102         }
    103        
     100
     101
     102        }
     103
    104104        echo '<form action="admin.php?import=utw&amp;step=2" method="post">';
    105105        echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2 &raquo;').'" /></p>';
     
    107107        echo '</div>';
    108108    }
    109    
    110    
     109
     110
    111111    function import_posts ( ) {
    112112        echo '<div class="narrow">';
     
    129129
    130130            add_option('utwimp_posts', $posts);
    131                
     131
    132132
    133133            $count = count($posts);
    134                
     134
    135135            echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>';
    136                
     136
    137137        }
    138138
     
    143143
    144144    }
    145    
    146    
     145
     146
    147147    function import_t2p ( ) {
    148148
     
    152152        // run that funky magic!
    153153        $tags_added = $this->tag2post();
    154        
     154
    155155        echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>';
    156156
     
    161161
    162162    }
    163    
    164    
     163
     164
    165165    function get_utw_tags ( ) {
    166    
     166
    167167        global $wpdb;
    168        
     168
    169169        // read in all the tags from the UTW tags table: should be wp_tags
    170170        $tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags";
    171        
     171
    172172        $tags = $wpdb->get_results($tags_query);
    173        
     173
    174174        // rearrange these tags into something we can actually use
    175175        foreach ( $tags as $tag ) {
    176            
     176
    177177            $new_tags[$tag->tag_id] = $tag->tag;
    178            
    179         }
    180        
     178
     179        }
     180
    181181        return $new_tags;
    182182
    183183    }
    184    
     184
    185185    function get_utw_posts ( ) {
    186        
     186
    187187        global $wpdb;
    188        
     188
    189189        // read in all the posts from the UTW post->tag table: should be wp_post2tag
    190190        $posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag";
    191        
     191
    192192        $posts = $wpdb->get_results($posts_query);
    193        
     193
    194194        return $posts;
    195        
    196     }
    197    
    198    
     195
     196    }
     197
     198
    199199    function tag2post ( ) {
    200        
     200
    201201        // get the tags and posts we imported in the last 2 steps
    202202        $tags = get_option('utwimp_tags');
    203203        $posts = get_option('utwimp_posts');
    204        
     204
    205205        // null out our results
    206206        $tags_added = 0;
    207        
     207
    208208        // loop through each post and add its tags to the db
    209209        foreach ( $posts as $this_post ) {
    210            
     210
    211211            $the_post = (int) $this_post->post_id;
    212212            $the_tag = (int) $this_post->tag_id;
    213            
     213
    214214            // what's the tag name for that id?
    215215            $the_tag = $tags[$the_tag];
    216            
     216
    217217            // screw it, just try to add the tag
    218218            wp_add_post_tags($the_post, $the_tag);
    219219
    220220            $tags_added++;
    221            
    222         }
    223        
     221
     222        }
     223
    224224        // that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
    225225        return $tags_added;
    226        
    227        
    228     }
    229    
    230    
     226
     227
     228    }
     229
     230
    231231    function cleanup_import ( ) {
    232        
     232
    233233        delete_option('utwimp_tags');
    234234        delete_option('utwimp_posts');
    235        
     235
    236236        $this->done();
    237        
    238     }
    239    
    240    
     237
     238    }
     239
     240
    241241    function done ( ) {
    242        
     242
    243243        echo '<div class="narrow">';
    244244        echo '<p><h3>'.__('Import Complete!').'</h3></p>';
    245        
     245
    246246        echo '<p>' . __('OK, so we lied about this being a 5-step program! You&#8217;re done!') . '</p>';
    247        
     247
    248248        echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>';
    249        
    250         echo '</div>';
    251        
    252     }
    253    
     249
     250        echo '</div>';
     251
     252    }
     253
    254254
    255255    function UTW_Import ( ) {
    256        
     256
    257257        // Nothing.
    258        
    259     }
    260    
     258
     259    }
     260
    261261}
    262262
  • trunk/wp-admin/import/wordpress.php

    r5448 r5700  
    252252        echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
    253253    }
    254  
     254
    255255    function process_post($post) {
    256256        global $wpdb;
     
    259259        if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already
    260260            return 0;
    261      
     261
    262262        // There are only ever one of these
    263263        $post_title     = $this->get_tag( $post, 'title' );
     
    312312            if ( $post_id && $post_ID && $this->posts_processed[$post_ID] )
    313313                $this->posts_processed[$post_ID][1] = $post_id; // New ID.
    314            
     314
    315315            // Add categories.
    316316            if (count($categories) > 0) {
  • trunk/wp-admin/import/wp-cat2tag.php

    r5554 r5700  
    44    var $categories_to_convert = array();
    55    var $all_categories = array();
    6    
     6
    77    function header() {
    88        print '<div class="wrap">';
    99        print '<h2>' . __('Convert Categories to Tags') . '</h2>';
    1010    }
    11    
     11
    1212    function footer() {
    1313        print '</div>';
    1414    }
    15    
     15
    1616    function populate_all_categories() {
    1717        global $wpdb;
    18        
     18
    1919        $this->all_categories = get_categories('get=all');
    2020    }
    21    
     21
    2222    function welcome() {
    2323        $this->populate_all_categories();
    24        
     24
    2525        print '<div class="narrow">';
    26        
     26
    2727        if (count($this->all_categories) > 0) {
    2828            print '<p>' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '</p>';
    2929            print '<p>' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '</p>';
    30        
     30
    3131            $this->categories_form();
    3232        } else {
    3333            print '<p>'.__('You have no categories to convert!').'</p>';
    3434        }
    35        
     35
    3636        print '</div>';
    3737    }
    38    
     38
    3939    function categories_form() {
    4040        print '<form action="admin.php?import=wp-cat2tag&amp;step=2" method="post">';
    4141        print '<ul style="list-style:none">';
    42        
     42
    4343        $hier = _get_term_hierarchy('category');
    44        
     44
    4545        foreach ($this->all_categories as $category) {
    4646            if ((int) $category->parent == 0) {
    4747                print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>';
    48                
     48
    4949                if (isset($hier[$category->term_id])) {
    5050                    $this->_category_children($category, $hier);
    5151                }
    52                
     52
    5353                print '</li>';
    5454            }
    5555        }
    56        
     56
    5757        print '</ul>';
    58        
     58
    5959        print '<p class="submit"><input type="submit" name="maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>';
    6060        print '</form>';
    6161    }
    62    
     62
    6363    function _category_children($parent, $hier) {
    6464        print '<ul style="list-style:none">';
    65        
     65
    6666        foreach ($hier[$parent->term_id] as $child_id) {
    6767            $child =& get_category($child_id);
    68            
     68
    6969            print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>';
    70            
     70
    7171            if (isset($hier[$child->term_id])) {
    7272                $this->_category_children($child, $hier);
    7373            }
    74            
     74
    7575            print '</li>';
    7676        }
    77        
     77
    7878        print '</ul>';
    7979    }
    80    
     80
    8181    function _category_exists($cat_id) {
    8282        global $wpdb;
    83        
     83
    8484        $cat_id = (int) $cat_id;
    85        
     85
    8686        $maybe_exists = category_exists($cat_id);
    87        
     87
    8888        if ( $maybe_exists ) {
    8989            return true;
     
    9292        }
    9393    }
    94    
     94
    9595    function convert_them() {
    9696        global $wpdb;
    97        
     97
    9898        if (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) {
    9999            print '<div class="narrow">';
     
    101101            print '</div>';
    102102        }
    103        
    104        
     103
     104
    105105        if ( empty($this->categories_to_convert) )
    106106            $this->categories_to_convert = $_POST['cats_to_convert'];
    107107        $hier = _get_term_hierarchy('category');
    108        
     108
    109109        print '<ul>';
    110        
     110
    111111        foreach ($this->categories_to_convert as $cat_id) {
    112112            $cat_id = (int) $cat_id;
    113            
     113
    114114            print '<li>' . __('Converting category') . ' #' . $cat_id . '... ';
    115            
     115
    116116            if (!$this->_category_exists($cat_id)) {
    117117                _e('Category doesn\'t exist!');
    118118            } else {
    119119                $category =& get_category($cat_id);
    120                
     120
    121121                // Set the category itself to $type from above
    122122                $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
    123                
     123
    124124                // Set all parents to 0 (root-level) if their parent was the converted tag
    125125                $wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
    126                
     126
    127127                // Clean the cache
    128128                clean_category_cache($category->term_id);
    129                
     129
    130130                _e('Converted successfully.');
    131131            }
    132            
     132
    133133            print '</li>';
    134134        }
    135        
     135
    136136        print '</ul>';
    137137    }
    138    
     138
    139139    function convert_all_confirm() {
    140140        print '<div class="narrow">';
    141        
     141
    142142        print '<h3>' . __('Confirm') . '</h3>';
    143        
     143
    144144        print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>';
    145        
     145
    146146        print '<form action="admin.php?import=wp-cat2tag" method="post">';
    147147        print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>';
    148148        print '</form>';
    149        
     149
    150150        print '</div>';
    151151    }
    152    
     152
    153153    function convert_all() {
    154154        global $wpdb;
     
    157157        clean_category_cache($category->term_id);
    158158    }
    159    
     159
    160160    function init() {
    161161        echo '<!--'; print_r($_POST); print_r($_GET); echo '-->';
    162        
     162
    163163        if (isset($_POST['maybe_convert_all_cats'])) {
    164164            $step = 3;
     
    170170            $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
    171171        }
    172        
     172
    173173        $this->header();
    174        
     174
    175175        if (!current_user_can('manage_categories')) {
    176176            print '<div class="narrow">';
     
    182182                    $this->welcome();
    183183                break;
    184                
     184
    185185                case 2 :
    186186                    $this->convert_them();
    187187                break;
    188                
     188
    189189                case 3 :
    190190                    $this->convert_all_confirm();
    191191                break;
    192                
     192
    193193                case 4 :
    194194                    $this->convert_all();
     
    196196            }
    197197        }
    198        
     198
    199199        $this->footer();
    200200    }
    201    
     201
    202202    function WP_Categories_to_Tags() {
    203203        // Do nothing.
  • trunk/wp-admin/includes/bookmark.php

    r5637 r5700  
    4747
    4848    $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
    49    
     49
    5050    do_action('deleted_link', $link_id);
    5151
  • trunk/wp-admin/includes/file.php

    r5566 r5700  
    139139        if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
    140140            return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
    141        
     141
    142142        if ( !$ext )
    143143            $ext = strrchr($file['name'], '.');
  • trunk/wp-admin/includes/image.php

    r5566 r5700  
    122122    if (function_exists('imageantialias'))
    123123        imageantialias( $dst, true );
    124    
     124
    125125    imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
    126126
  • trunk/wp-admin/includes/plugin.php

    r5630 r5700  
    88    preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
    99    preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
    10    
     10
    1111    if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
    1212        $version = trim( $version[1] );
  • trunk/wp-admin/includes/schema.php

    r5551 r5700  
    393393function populate_roles_230() {
    394394    $role = get_role( 'administrator' );
    395    
     395
    396396    if ( !empty( $role ) ) {
    397397        $role->add_cap( 'unfiltered_upload' );
  • trunk/wp-admin/includes/template.php

    r5692 r5700  
    150150
    151151    $categories = get_terms('link_category', 'orderby=count&hide_empty=0');
    152    
     152
    153153    if ( empty($categories) )
    154154        return;
     
    422422    if ( $for_post )
    423423        $edit = ( ('draft' == $post->post_status ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
    424  
     424
    425425    echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';
    426426
  • trunk/wp-admin/includes/theme.php

    r5630 r5700  
    3434        foreach ( $templates as $template ) {
    3535            $template_data = implode( '', file( ABSPATH.$template ));
    36            
     36
    3737            preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
    3838            preg_match( '|Description:(.*)$|mi', $template_data, $description );
  • trunk/wp-admin/includes/upgrade.php

    r5643 r5700  
    188188    if ( $wp_current_db_version < 4351 )
    189189        upgrade_old_slugs();
    190    
     190
    191191    if ( $wp_current_db_version < 5539 )
    192192        upgrade_230();
    193193
    194    
     194
    195195    maybe_disable_automattic_widgets();
    196196
     
    577577function upgrade_230() {
    578578    global $wp_current_db_version, $wpdb;
    579    
     579
    580580    if ( $wp_current_db_version < 5200 ) {
    581581        populate_roles_230();
     
    629629            $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
    630630        }
    631        
     631
    632632        if ( empty($count) ) {
    633633            $count = 0;
     
    757757function __get_option($setting) {
    758758    global $wpdb;
    759    
     759
    760760    if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
    761761        return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) );
    762762    }
    763    
     763
    764764    if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
    765765        return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
    766766    }
    767    
     767
    768768    $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
    769769
     
    12091209function maybe_disable_automattic_widgets() {
    12101210    $plugins = __get_option( 'active_plugins' );
    1211    
     1211
    12121212    foreach ( (array) $plugins as $plugin ) {
    12131213        if ( basename( $plugin ) == 'widgets.php' ) {
  • trunk/wp-admin/link-import.php

    r5439 r5700  
    9999                $opml = file_get_contents($opml_url);
    100100            }
    101            
     101
    102102            include_once('link-parse-opml.php');
    103103
  • trunk/wp-admin/moderation.php

    r5663 r5700  
    2020if ( $action == 'update' ) {
    2121    check_admin_referer( 'moderate-comments' );
    22    
     22
    2323    if ( !current_user_can( 'moderate_comments' ) ) {
    2424        wp_die( __( 'Your level is not high enough to moderate comments.' ) );
    2525    }
    26    
     26
    2727    $item_ignored = 0;
    2828    $item_deleted = 0;
    2929    $item_approved = 0;
    3030    $item_spam = 0;
    31    
     31
    3232    foreach ( $comment as $k => $v ) {
    3333        if ( $feelinglucky && $v == 'later' ) {
    3434            $v = 'delete';
    3535        }
    36        
     36
    3737        switch ( $v ) {
    3838            case 'later' :
    3939                $item_ignored++;
    4040            break;
    41            
     41
    4242            case 'delete' :
    4343                wp_set_comment_status( $k, 'delete' );
    4444                $item_deleted++;
    4545            break;
    46            
     46
    4747            case 'spam' :
    4848                wp_set_comment_status( $k, 'spam' );
    4949                $item_spam++;
    5050            break;
    51            
     51
    5252            case 'approve' :
    5353                wp_set_comment_status( $k, 'approve' );
    54                
     54
    5555                if ( get_option( 'comments_notify' ) == true ) {
    5656                    wp_notify_postauthor( $k );
    5757                }
    58                
     58
    5959                $item_approved++;
    6060            break;
    6161        }
    6262    }
    63    
     63
    6464    wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam );
    6565    exit;
     
    7878    $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
    7979    $spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0;
    80    
     80
    8181    if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
    8282        echo '<div id="moderated" class="updated fade"><p>';
    83    
     83
    8484        if ( $approved > 0 ) {
    8585            printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved );
    8686            echo '<br />';
    8787        }
    88    
     88
    8989        if ( $deleted > 0 ) {
    9090            printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted );
    9191            echo '<br />';
    9292        }
    93    
     93
    9494        if ( $spam > 0 ) {
    9595            printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
    9696            echo '<br />';
    9797        }
    98    
     98
    9999        echo '</p></div>';
    100100    }
     
    138138?>
    139139    <h2><?php _e( 'Moderation Queue' ); ?></h2>
    140    
     140
    141141    <?php
    142142        if ( $page_links ) {
     
    144144        }
    145145    ?>
    146    
     146
    147147    <form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post">
    148148        <?php wp_nonce_field( 'moderate-comments' ); ?>
     
    151151    <?php
    152152        $i = 0;
    153        
     153
    154154        foreach ( $comments as $comment ) {
    155155            $class = 'js-unapproved';
    156            
     156
    157157            if ( $i++ % 2 ) {
    158158                $class .= ' alternate';
     
    166166                    | <?php _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a>
    167167                </p>
    168                
     168
    169169                <p>
    170170                    <?php comment_text(); ?>
     
    190190    ?>
    191191        </ol>
    192        
     192
    193193        <?php
    194194            if ( $page_links ) {
     
    196196            }
    197197        ?>
    198        
     198
    199199        <div id="ajax-response"></div>
    200        
     200
    201201        <noscript>
    202202            <p class="submit">
     
    204204            </p>
    205205        </noscript>
    206        
     206
    207207        <p class="submit">
    208208            <input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments &raquo;' ); ?>" />
    209209        </p>
    210        
     210
    211211        <script type="text/javascript">
    212212        // <![CDATA[
     
    218218                }
    219219            }
    220        
     220
    221221            document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' );
    222222        // ]]>
  • trunk/wp-admin/options-general.php

    r5395 r5700  
    77include('./admin-header.php');
    88?>
    9  
     9
    1010<div class="wrap">
    1111<h2><?php _e('General Options') ?></h2>
  • trunk/wp-admin/options.php

    r5541 r5700  
    3535        }
    3636    }
    37    
     37
    3838    $referred = remove_query_arg('updated' , wp_get_referer());
    3939    $goback = add_query_arg('updated', 'true', wp_get_referer());
  • trunk/wp-admin/plugins.php

    r5239 r5700  
    3232        check_admin_referer('deactivate-all');
    3333        $current = get_option('active_plugins');
    34        
     34
    3535        foreach ($current as $plugin) {
    3636            array_splice($current, array_search($plugin, $current), 1);
    3737            do_action('deactivate_' . $plugin);
    3838        }
    39        
     39
    4040        update_option('active_plugins', array());
    4141        wp_redirect('plugins.php?deactivate-all=true');
  • trunk/wp-admin/widgets.php

    r5631 r5700  
    1111function wp_widgets_admin_head() {
    1212    global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls;
    13    
     13
    1414    define( 'WP_WIDGETS_WIDTH', 1 + 262 * ( count( $wp_registered_sidebars ) ) );
    1515    define( 'WP_WIDGETS_HEIGHT', 35 * ( count( $wp_registered_widgets ) ) );
     
    3131<?php
    3232    }
    33    
     33
    3434    $cols = array();
    3535    foreach ( $wp_registered_sidebars as $index => $sidebar ) {
     
    3737    }
    3838    $cols = implode( ', ', $cols );
    39    
     39
    4040    $widgets = array();
    4141    foreach ( $wp_registered_widgets as $name => $widget ) {
     
    180180function wp_widget_draggable( $name ) {
    181181    global $wp_registered_widgets, $wp_registered_widget_controls;
    182    
     182
    183183    if ( !isset( $wp_registered_widgets[$name] ) ) {
    184184        return;
    185185    }
    186    
     186
    187187    $sanitized_name = sanitize_title( $wp_registered_widgets[$name]['id'] );
    188188    $link_title = __( 'Configure' );
     
    190190        ? ' <div class="popper" id="' . $sanitized_name . 'popper" title="' . $link_title . '">&#8801;</div>'
    191191        : '';
    192    
     192
    193193    $output = '<li class="module" id="widgetprefix-%1$s"><span class="handle">%2$s</span></li>';
    194    
     194
    195195    printf( $output, $sanitized_name, $wp_registered_widgets[$name]['name'] . $popper );
    196196}
     
    205205    <div class="wrap">
    206206        <h2><?php _e( 'No Sidebars Defined' ); ?></h2>
    207        
     207
    208208        <p><?php _e( 'You are seeing this message because the theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://automattic.com/code/widgets/themes/">follow these instructions</a>.' ); /* TODO: article on codex */; ?></p>
    209209    </div>
    210210<?php
    211    
     211
    212212    require_once 'admin-footer.php';
    213213    exit;
     
    222222if ( isset( $_POST['action'] ) ) {
    223223    check_admin_referer( 'widgets-save-widget-order' );
    224    
     224
    225225    switch ( $_POST['action'] ) {
    226226        case 'default' :
     
    228228            wp_set_sidebars_widgets( $sidebars_widgets );
    229229        break;
    230        
     230
    231231        case 'save_widget_order' :
    232232            $sidebars_widgets = array();
    233            
     233
    234234            foreach ( $wp_registered_sidebars as $index => $sidebar ) {
    235235                $postindex = $index . 'order';
    236                
     236
    237237                parse_str( $_POST[$postindex], $order );
    238                
     238
    239239                $new_order = $order[$index];
    240                
     240
    241241                if ( is_array( $new_order ) ) {
    242242                    foreach ( $new_order as $sanitized_name ) {
     
    249249                }
    250250            }
    251            
     251
    252252            wp_set_sidebars_widgets( $sidebars_widgets );
    253253        break;
     
    261261foreach ( $wp_registered_widgets as $name => $widget ) {
    262262    $is_active = false;
    263    
     263
    264264    foreach ( $wp_registered_sidebars as $index => $sidebar ) {
    265265        if ( is_array( $sidebars_widgets[$index] ) && in_array( $name, $sidebars_widgets[$index] ) ) {
     
    268268        }
    269269    }
    270    
     270
    271271    if ( !$is_active ) {
    272272        $inactive_widgets[] = $name;
     
    298298    <div class="wrap">
    299299        <h2><?php _e( 'Sidebar Arrangement' ); ?></h2>
    300        
     300
    301301        <p><?php _e( 'You can drag and drop widgets onto your sidebar below.' ); ?></p>
    302        
     302
    303303        <form id="sbadmin" method="post" onsubmit="serializeAll();">
    304304            <p class="submit">
     
    310310            ?>
    311311                <input type="hidden" id="<?php echo $index; ?>order" name="<?php echo $index; ?>order" value="" />
    312                
     312
    313313                <div class="dropzone">
    314314                    <h3><?php echo $sidebar['name']; ?></h3>
    315                    
     315
    316316                    <div id="<?php echo $index; ?>placematt" class="module placemat">
    317317                        <span class="handle">
     
    320320                        </span>
    321321                    </div>
    322                    
     322
    323323                    <ul id="<?php echo $index; ?>">
    324324                    <?php
     
    334334                }
    335335            ?>
    336            
     336
    337337            <br class="clear" />
    338            
     338
    339339            </div>
    340        
     340
    341341            <div id="palettediv">
    342342                <h3><?php _e( 'Available Widgets' ); ?></h3>
    343            
     343
    344344                <ul id="palette">
    345345                <?php
     
    351351                </ul>
    352352            </div>
    353        
     353
    354354            <script type="text/javascript">
    355355            // <![CDATA[
     
    363363            // ]]>
    364364            </script>
    365        
     365
    366366            <p class="submit">
    367367            <?php wp_nonce_field( 'widgets-save-widget-order' ); ?>
     
    369369                <input type="submit" value="<?php _e( 'Save Changes &raquo;' ); ?>" />
    370370            </p>
    371        
     371
    372372            <div id="controls">
    373373            <?php foreach ( $wp_registered_widget_controls as $name => $widget ) { ?>
     
    382382            </div>
    383383        </form>
    384        
     384
    385385        <br class="clear" />
    386386    </div>
    387    
     387
    388388    <div id="shadow"> </div>
    389    
     389
    390390    <?php do_action( 'sidebar_admin_page' ); ?>
    391391
  • trunk/wp-app.php

    r5547 r5700  
    110110        while(!feof($fp)) {
    111111            $line = fgets($fp, 4096);
    112          
     112
    113113            if($app_logging) $contents .= $line;
    114114
     
    163163                array_push($this->in_content, ">");
    164164            }
    165          
     165
    166166            array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
    167167        } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
  • trunk/wp-content/themes/default/sidebar.php

    r5151 r5700  
    4141
    4242            <?php } ?>
    43                
     43
    4444            </li> <?php }?>
    4545
     
    6868                </li>
    6969            <?php } ?>
    70            
     70
    7171            <?php endif; ?>
    7272        </ul>
  • trunk/wp-includes/author-template.php

    r5699 r5700  
    363363function wp_list_authors($args = '') {
    364364    global $wpdb;
    365    
     365
    366366    $defaults = array(
    367367        'optioncount' => false, 'exclude_admin' => true,
  • trunk/wp-includes/bookmark-template.php

    r5560 r5700  
    1010function wp_get_links($args = '') {
    1111    global $wpdb;
    12    
     12
    1313    if ( strpos( $args, '=' ) === false ) {
    1414        $cat_id = $args;
    1515        $args = add_query_arg( 'category', $cat_id, $args );
    1616    }
    17    
     17
    1818    $defaults = array(
    1919        'category' => -1, 'before' => '',
     
    2424        'echo' => true
    2525    );
    26    
     26
    2727    $r = wp_parse_args( $args, $defaults );
    2828    extract( $r );
     
    132132        if ( $show_description && '' != $desc )
    133133            $output .= $between . $desc;
    134        
     134
    135135        if ($show_rating) {
    136136            $output .= $between . get_linkrating($row);
     
    246246        'after' => '</li>', 'between' => "\n"
    247247    );
    248    
     248
    249249    $r = wp_parse_args( $args, $defaults );
    250250    extract( $r );
     
    303303        if ( $show_description && '' != $desc )
    304304            $output .= $between . $desc;
    305        
     305
    306306        if ($show_rating) {
    307307            $output .= $between . get_linkrating($bookmark);
    308308        }
    309        
     309
    310310        $output .= "$after\n";
    311311    } // end while
     
    326326        'category_after' => '</li>'
    327327    );
    328    
     328
    329329    $r = wp_parse_args( $args, $defaults );
    330330    extract( $r );
  • trunk/wp-includes/bookmark.php

    r5561 r5700  
    2626function get_bookmarks($args = '') {
    2727    global $wpdb;
    28    
     28
    2929    $defaults = array(
    3030        'orderby' => 'name', 'order' => 'ASC',
     
    3434        'exclude' => ''
    3535    );
    36    
     36
    3737    $r = wp_parse_args( $args, $defaults );
    3838    extract( $r );
  • trunk/wp-includes/category-template.php

    r5693 r5700  
    187187        'name' => 'cat', 'class' => 'postform'
    188188    );
    189    
     189
    190190    $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0;
    191    
     191
    192192    $r = wp_parse_args( $args, $defaults );
    193193    $r['include_last_update_time'] = $r['show_last_update'];
     
    237237        'hierarchical' => true, 'title_li' => __('Categories')
    238238    );
    239    
     239
    240240    $r = wp_parse_args( $args, $defaults );
    241    
     241
    242242    if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
    243243        $r['pad_counts'] = true;
    244244    }
    245    
     245
    246246    if ( isset( $r['show_date'] ) ) {
    247247        $r['include_last_update_time'] = $r['show_date'];
    248248    }
    249    
     249
    250250    extract( $r );
    251    
     251
    252252    $categories = get_categories($r);
    253253
     
    263263    } else {
    264264        global $wp_query;
    265        
     265
    266266        if( !empty($show_option_all) )
    267267            if ('list' == $style ) 
     
    269269            else
    270270                $output .= '<a href="' .  get_bloginfo('url')  . '">' . $show_option_all . '</a>';
    271        
     271
    272272        if ( is_category() )
    273273            $r['current_category'] = $wp_query->get_queried_object_id();
     
    410410function get_the_tags( $id = 0 ) {
    411411    global $post;
    412  
     412
    413413    $id = (int) $id;
    414414
    415415    if ( ! $id && ! in_the_loop() )
    416416        return false; // in-the-loop function
    417  
     417
    418418    if ( !$id )
    419419        $id = (int) $post->ID;
     
    434434    if ( empty( $tags ) )
    435435        return false;
    436    
     436
    437437    $tag_list = $before;
    438438    foreach ( $tags as $tag )
  • trunk/wp-includes/class-IXR.php

    r3279 r5700  
    4848        // If it is a normal PHP object convert it in to a struct
    4949        if (is_object($this->data)) {
    50            
     50
    5151            $this->data = get_object_vars($this->data);
    5252            return 'struct';
  • trunk/wp-includes/class-phpmailer.php

    r5682 r5700  
    114114     */
    115115    var $Sendmail          = "/usr/sbin/sendmail";
    116    
     116
    117117    /**
    118118     * Path to PHPMailer plugins.  This is now only useful if the SMTP class
     
    223223    var $LE              = "\n";
    224224    /**#@-*/
    225    
     225
    226226    /////////////////////////////////////////////////
    227227    // VARIABLE METHODS
     
    383383        return $result;
    384384    }
    385    
     385
    386386    /**
    387387     * Sends mail using the $Sendmail program. 
     
    403403        fputs($mail, $header);
    404404        fputs($mail, $body);
    405        
     405
    406406        $result = pclose($mail) >> 8 & 0xFF;
    407407        if($result != 0)
     
    549549                else
    550550                    $this->smtp->Hello($this->ServerHostname());
    551        
     551
    552552                if($this->SMTPAuth)
    553553                {
     
    605605        }
    606606        $this->language = $PHPMAILER_LANG;
    607    
     607
    608608        return true;
    609609    }
     
    630630        return $addr_str;
    631631    }
    632    
     632
    633633    /**
    634634     * Formats an address correctly.
     
    727727        return $message;
    728728    }
    729    
     729
    730730    /**
    731731     * Set the body wrapping.
     
    736736        if($this->WordWrap < 1)
    737737            return;
    738            
     738
    739739        switch($this->message_type)
    740740        {
     
    757757    function CreateHeader() {
    758758        $result = "";
    759        
     759
    760760        // Set the boundaries
    761761        $uniq_id = md5(uniqid(time()));
     
    768768        else
    769769            $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
    770        
     770
    771771        // To be created automatically by mail()
    772772        if($this->Mailer != "mail")
     
    798798        $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
    799799        $result .= $this->HeaderLine("X-Priority", $this->Priority);
    800        
     800
    801801        if($this->ConfirmReadingTo != "")
    802802        {
     
    866866                $result .= $this->GetBoundary($this->boundary[1], "",
    867867                                              "text/html", "");
    868                
     868
    869869                $result .= $this->EncodeString($this->Body, $this->Encoding);
    870870                $result .= $this->LE.$this->LE;
    871    
     871
    872872                $result .= $this->EndBoundary($this->boundary[1]);
    873873                break;
     
    879879                $result .= $this->EncodeString($this->Body, $this->Encoding);
    880880                $result .= $this->LE;
    881      
     881
    882882                $result .= $this->AttachAll();
    883883                break;
     
    888888                                   "multipart/alternative", $this->LE,
    889889                                   $this->boundary[2], $this->LE.$this->LE);
    890    
     890
    891891                // Create text body
    892892                $result .= $this->GetBoundary($this->boundary[2], "",
     
    895895                $result .= $this->EncodeString($this->AltBody, $this->Encoding);
    896896                $result .= $this->LE.$this->LE;
    897    
     897
    898898                // Create the HTML body
    899899                $result .= $this->GetBoundary($this->boundary[2], "",
    900900                                              "text/html", "") . $this->LE;
    901    
     901
    902902                $result .= $this->EncodeString($this->Body, $this->Encoding);
    903903                $result .= $this->LE.$this->LE;
    904904
    905905                $result .= $this->EndBoundary($this->boundary[2]);
    906                
     906
    907907                $result .= $this->AttachAll();
    908908                break;
     
    930930        $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding);
    931931        $result .= $this->LE;
    932        
     932
    933933        return $result;
    934934    }
    935    
     935
    936936    /**
    937937     * Returns the end of a message boundary.
     
    941941        return $this->LE . "--" . $boundary . "--" . $this->LE;
    942942    }
    943    
     943
    944944    /**
    945945     * Sets the message type.
     
    10441044            $disposition = $this->attachment[$i][6];
    10451045            $cid         = $this->attachment[$i][7];
    1046            
     1046
    10471047            $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
    10481048            $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
     
    10741074        return join("", $mime);
    10751075    }
    1076    
     1076
    10771077    /**
    10781078     * Encodes attachment in requested format.  Returns an
     
    11361136    function EncodeHeader ($str, $position = 'text') {
    11371137      $x = 0;
    1138      
     1138
    11391139      switch (strtolower($position)) {
    11401140        case 'phrase':
     
    11781178      $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
    11791179      $encoded = trim(str_replace("\n", $this->LE, $encoded));
    1180      
     1180
    11811181      return $encoded;
    11821182    }
    1183    
     1183
    11841184    /**
    11851185     * Encode string to quoted-printable. 
     
    12271227            break;
    12281228        }
    1229        
     1229
    12301230        // Replace every spaces to _ (more readable than =20)
    12311231        $encoded = str_replace(" ", "_", $encoded);
     
    12571257        $this->attachment[$cur][7] = 0;
    12581258    }
    1259    
     1259
    12601260    /**
    12611261     * Adds an embedded attachment.  This can include images, sounds, and
     
    12731273    function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64",
    12741274                              $type = "application/octet-stream") {
    1275    
     1275
    12761276        if(!@is_file($path))
    12771277        {
     
    12941294        $this->attachment[$cur][6] = "inline";
    12951295        $this->attachment[$cur][7] = $cid;
    1296    
     1296
    12971297        return true;
    12981298    }
    1299    
     1299
    13001300    /**
    13011301     * Returns true if an inline attachment is present.
     
    13131313            }
    13141314        }
    1315        
     1315
    13161316        return $result;
    13171317    }
     
    14111411        return $result;
    14121412    }
    1413    
     1413
    14141414    /**
    14151415     * Returns the appropriate server variable.  Should work with both
     
    14291429                $_SERVER = $HTTP_ENV_VARS; // must be Apache
    14301430        }
    1431        
     1431
    14321432        if(isset($_SERVER[$varName]))
    14331433            return $_SERVER[$varName];
     
    14601460        if(count($this->language) < 1)
    14611461            $this->SetLanguage("en"); // set the default language
    1462    
     1462
    14631463        if(isset($this->language[$key]))
    14641464            return $this->language[$key];
     
    14661466            return "Language string failed to load: " . $key;
    14671467    }
    1468    
     1468
    14691469    /**
    14701470     * Returns true if an error occurred.
  • trunk/wp-includes/class-smtp.php

    r5390 r5700  
    2929     */
    3030    var $SMTP_PORT = 25;
    31    
     31
    3232    /**
    3333     *  SMTP reply line ending
     
    3535     */
    3636    var $CRLF = "\r\n";
    37    
     37
    3838    /**
    3939     *  Sets whether debugging is turned on
     
    509509
    510510        $this->helo_rply = $rply;
    511        
     511
    512512        return true;
    513513    }
  • trunk/wp-includes/classes.php

    r5640 r5700  
    693693            'data' => '', 'supplemental' => array()
    694694        );
    695        
     695
    696696        $r = wp_parse_args( $args, $defaults );
    697697        extract( $r );
  • trunk/wp-includes/cron.php

    r5274 r5700  
    8484    $cron_url = get_option( 'siteurl' ) . '/wp-cron.php';
    8585    $parts = parse_url( $cron_url );
    86    
     86
    8787    if ($parts['scheme'] == 'https') {
    8888        // support for SSL was added in 4.3.0
     
    9595        $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
    9696    }
    97    
     97
    9898    if ( $argyle )
    9999        fputs( $argyle,
  • trunk/wp-includes/formatting.php

    r5623 r5700  
    10861086        substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
    10871087        $url = 'http://' . $url;
    1088    
     1088
    10891089    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
    10901090    if ( !is_array($protocols) )
  • trunk/wp-includes/functions.php

    r5694 r5700  
    707707function get_status_header_desc( $code ) {
    708708    global $wp_header_to_desc;
    709    
     709
    710710    $code = (int) $code;
    711    
     711
    712712    if ( isset( $wp_header_to_desc[$code] ) ) {
    713713        return $wp_header_to_desc[$code];
     
    719719function status_header( $header ) {
    720720    $text = get_status_header_desc( $header );
    721    
     721
    722722    if ( empty( $text ) )
    723723        return false;
     
    12971297        }
    12981298    }
    1299    
     1299
    13001300    if ( is_array( $defaults ) ) {
    13011301        return array_merge( $defaults, $r );
  • trunk/wp-includes/general-template.php

    r5625 r5700  
    6262function bloginfo($show='') {
    6363    $info = get_bloginfo($show);
    64    
     64
    6565    // Don't filter URL's.
    6666    if (strpos($show, 'url') === false &&
     
    323323function wp_get_archives($args = '') {
    324324    global $wpdb, $wp_locale;
    325    
     325
    326326    $defaults = array(
    327327        'type' => 'monthly', 'limit' => '',
     
    329329        'after' => '', 'show_post_count' => false
    330330    );
    331    
     331
    332332    $r = wp_parse_args( $args, $defaults );
    333333    extract( $r );
     
    594594    if ( $ak_post_titles ) {
    595595        foreach ( $ak_post_titles as $ak_post_title ) {
    596            
     596
    597597                $post_title = apply_filters( "the_title", $ak_post_title->post_title );
    598598                $post_title = str_replace('"', '&quot;', wptexturize( $post_title ));
    599                                
     599
    600600                if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
    601601                    $ak_titles_for_day['day_'.$ak_post_title->dom] = '';
     
    818818function user_can_richedit() {
    819819    global $wp_rich_edit, $pagenow;
    820    
     820
    821821    if ( !isset( $wp_rich_edit) ) {
    822822        if ( get_user_option( 'rich_editing' ) == 'true' &&
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php

    r5214 r5700  
    5050    function _xmlChars($string) {
    5151       $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
    52    
     52
    5353       foreach ($trans as $k => $v)
    5454            $trans[$k] = "&#".ord($k).";";
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php

    r4985 r5700  
    5050        $data = shell_exec($this->cmd);
    5151        @unlink($this->tmpfile);
    52        
     52
    5353        $returnData = array();
    5454        $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php

    r5614 r5700  
    116116                $result = $tinyspell->checkWords($words);
    117117            break;
    118    
     118
    119119            case "suggest":
    120120                $result = $tinyspell->getSuggestion($check);
     
    139139            $body  = '<?xml version="1.0" encoding="utf-8" ?>';
    140140            $body .= "\n";
    141            
     141
    142142            if (count($result) == 0)
    143143                $body .= '<res id="' . $id . '" cmd="'. $cmd .'" />';
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r5429 r5700  
    4949        $mce_popups_css = str_replace('http://', 'https://', $mce_popups_css);
    5050    }
    51    
     51
    5252    $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale());
    5353?>
  • trunk/wp-includes/js/tinymce/tiny_mce_gzip.php

    r5333 r5700  
    111111    // Patch loading functions
    112112    //$content .= "tinyMCE_GZ.start();";
    113    
     113
    114114    // Do init based on index
    115115    $content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);";
  • trunk/wp-includes/kses.php

    r5383 r5700  
    183183        'var' => array()
    184184    );
    185    
     185
    186186    $allowedtags = array(
    187187        'a' => array(
  • trunk/wp-includes/link-template.php

    r5611 r5700  
    274274function get_edit_post_link( $id = 0 ) {
    275275    $post = &get_post( $id );
    276    
     276
    277277    if ( $post->post_type == 'attachment' ) {
    278278        return;
     
    280280        if ( !current_user_can( 'edit_page', $post->ID ) )
    281281            return;
    282        
     282
    283283        $file = 'page';
    284284    } else {
    285285        if ( !current_user_can( 'edit_post', $post->ID ) )
    286286            return;
    287        
     287
    288288        $file = 'post';
    289289    }
    290    
     290
    291291    return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . '/wp-admin/' . $file . '.php?action=edit&amp;post=' . $post->ID, $post->ID );
    292292}
     
    300300        if ( !current_user_can( 'edit_page', $post->ID ) )
    301301            return;
    302        
     302
    303303        $file = 'page';
    304304    } else {
    305305        if ( !current_user_can( 'edit_post', $post->ID ) )
    306306            return;
    307        
     307
    308308        $file = 'post';
    309309    }
     
    316316    $comment = &get_comment( $comment_id );
    317317    $post = &get_post( $comment->comment_post_ID );
    318    
     318
    319319    if ( $post->post_type == 'attachment' ) {
    320320        return;
     
    454454function get_pagenum_link($pagenum = 1) {
    455455    global $wp_rewrite;
    456    
     456
    457457    $pagenum = (int) $pagenum;
    458    
     458
    459459    $request = remove_query_arg( 'paged' );
    460    
     460
    461461    $home_root = parse_url(get_option('home'));
    462462    $home_root = $home_root['path'];
    463463    $home_root = preg_quote( trailingslashit( $home_root ), '|' );
    464    
     464
    465465    $request = preg_replace('|^'. $home_root . '|', '', $request);
    466466    $request = preg_replace('|^/+|', '', $request);
    467    
     467
    468468    if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
    469469        $base = trailingslashit( get_bloginfo( 'home' ) );
     
    477477        $qs_regex = '|\?.*?$|';
    478478        preg_match( $qs_regex, $request, $qs_match );
    479        
     479
    480480        if ( $qs_match[0] ) {
    481481            $query_string = $qs_match[0];
     
    484484            $query_string = '';
    485485        }
    486        
     486
    487487        $request = preg_replace( '|page/(.+)/?$|', '', $request);
    488        
     488
    489489        $base = trailingslashit( get_bloginfo( 'url' ) );
    490        
     490
    491491        if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) {
    492492            $base .= 'index.php/';
    493493        }
    494        
     494
    495495        if ( $pagenum > 1 ) {
    496496            $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );
    497497        }
    498        
     498
    499499        $result = $base . $request . $query_string;
    500500    }
    501    
     501
    502502    return $result;
    503503}
  • trunk/wp-includes/locale.php

    r5308 r5700  
    9393        $trans = __('number_format_decimals');
    9494        $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans;
    95        
     95
    9696        $trans = __('number_format_decimal_point');
    9797        $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
     
    9999        $trans = __('number_format_thousands_sep');
    100100        $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
    101        
     101
    102102        // Import global locale vars set during inclusion of $locale.php.
    103103        foreach ( $this->locale_vars as $var ) {
  • trunk/wp-includes/pluggable.php

    r5683 r5700  
    160160function wp_mail( $to, $subject, $message, $headers = '' ) {
    161161    global $phpmailer;
    162    
     162
    163163    // (Re)create it, if it's gone missing
    164164    if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
     
    167167        $phpmailer = new PHPMailer();
    168168    }
    169    
     169
    170170    // Compact the input, apply the filters, and extract them back out
    171171    extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) );
    172    
     172
    173173    // Default headers
    174174    if ( empty( $headers ) ) {
     
    181181        $tempheaders = (array) explode( "\n", $headers );
    182182        $headers = array();
    183        
     183
    184184        // If it's actually got contents
    185185        if ( !empty( $tempheaders ) ) {
     
    188188                // Explode them out
    189189                list( $name, $content ) = explode( ':', trim( $header ), 2 );
    190                
     190
    191191                // Cleanup crew
    192192                $name = trim( $name );
    193193                $content = trim( $content );
    194                
     194
    195195                // Mainly for legacy -- process a From: header if it's there
    196196                if ( $name == 'From' ) {
     
    200200                        $from_name = str_replace( '"', '', $from_name );
    201201                        $from_name = trim( $from_name );
    202                        
     202
    203203                        $from_email = substr( $content, strpos( '<', $content ) + 1 );
    204204                        $from_email = str_replace( '>', '', $from_email );
     
    222222        }
    223223    }
    224    
     224
    225225    // Empty out the values that may be set
    226226    $phpmailer->ClearAddresses();
     
    231231    $phpmailer->ClearCustomHeaders();
    232232    $phpmailer->ClearReplyTos();
    233    
     233
    234234    // From email and name
    235235    // If we don't have a name from the input headers
     
    237237        $from_name = 'WordPress';
    238238    }
    239    
     239
    240240    // If we don't have an email from the input headers
    241241    if ( !isset( $from_email ) ) {
     
    245245            $sitename = substr( $sitename, 4 );
    246246        }
    247        
     247
    248248        $from_email = 'wordpress@' . $sitename;
    249249    }
    250    
     250
    251251    // Set the from name and email
    252252    $phpmailer->From = apply_filters( 'wp_mail_from', $from_email );
    253253    $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
    254    
     254
    255255    // Set destination address
    256256    $phpmailer->AddAddress( $to );
    257    
     257
    258258    // Set mail's subject and body
    259259    $phpmailer->Subject = $subject;
    260260    $phpmailer->Body = $message;
    261    
     261
    262262    // Set to use PHP's mail()
    263263    $phpmailer->IsMail();
    264    
     264
    265265    // Set Content-Type and charset
    266266    // If we don't have a content-type from the input headers
     
    268268        $content_type = 'text/plain';
    269269    }
    270    
     270
    271271    // Set whether it's plaintext or not, depending on $content_type
    272272    if ( $content_type == 'text/html' ) {
     
    275275        $phpmailer->IsHTML( false );
    276276    }
    277    
     277
    278278    // If we don't have a charset from the input headers
    279279    if ( !isset( $charset ) ) {
    280280        $charset = get_bloginfo( 'charset' );
    281281    }
    282    
     282
    283283    // Set the content-type and charset
    284284    $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' );
    285285    $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
    286    
     286
    287287    // Set custom headers
    288288    if ( !empty( $headers ) ) {
     
    291291        }
    292292    }
    293    
     293
    294294    do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
    295    
     295
    296296    // Send!
    297297    $result = @$phpmailer->Send();
    298    
     298
    299299    return $result;
    300300}
     
    534534
    535535    @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
    536    
     536
    537537    return true;
    538538}
     
    550550    if( get_option( "moderation_notify" ) == 0 )
    551551        return true;
    552    
     552
    553553    $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
    554554    $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
  • trunk/wp-includes/post-template.php

    r5615 r5700  
    142142        'more_file' => '', 'echo' => 1
    143143    );
    144    
     144
    145145    $r = wp_parse_args( $args, $defaults );
    146146    extract( $r );
     
    255255        'name' => 'page_id', 'show_option_none' => ''
    256256    );
    257    
     257
    258258    $r = wp_parse_args( $args, $defaults );
    259259    extract( $r );
     
    286286        'authors' => '', 'sort_column' => 'menu_order, post_title'
    287287    );
    288    
     288
    289289    $r = wp_parse_args( $args, $defaults );
    290290    extract( $r );
  • trunk/wp-includes/post.php

    r5685 r5700  
    2828function &get_children($args = '', $output = OBJECT) {
    2929    global $post_cache, $wpdb, $blog_id;
    30    
     30
    3131    if ( empty( $args ) ) {
    3232        if ( isset( $GLOBALS['post'] ) ) {
     
    4040        $args = 'post_parent=' . (int) $args;
    4141    }
    42    
     42
    4343    $defaults = array(
    4444        'numberposts' => -1, 'post_type' => '',
    4545        'post_status' => '', 'post_parent' => 0
    4646    );
    47    
     47
    4848    $r = wp_parse_args( $args, $defaults );
    4949
     
    175175function get_posts($args) {
    176176    global $wpdb;
    177    
     177
    178178    $defaults = array(
    179179        'numberposts' => 5, 'offset' => 0,
     
    184184        'post_status' => 'publish', 'post_parent' => 0
    185185    );
    186    
     186
    187187    $r = wp_parse_args( $args, $defaults );
    188188    extract( $r );
    189    
     189
    190190    $numberposts = (int) $numberposts;
    191191    $offset = (int) $offset;
     
    431431
    432432    do_action('deleted_post', $postid);
    433    
     433
    434434    return $post;
    435435}
     
    450450    $defaults = array('fields' => 'all');
    451451    $args = wp_parse_args( $args, $defaults );
    452    
     452
    453453    $tags = get_object_terms($post_id, 'post_tag', $args);
    454454
     
    778778    /* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */
    779779    global $wpdb;
    780    
     780
    781781    $post_id = (int) $post_id;
    782    
     782
    783783    if ( !$post_id )
    784784        return false;
     
    10411041function &get_pages($args = '') {
    10421042    global $wpdb;
    1043    
     1043
    10441044    $defaults = array(
    10451045        'child_of' => 0, 'sort_order' => 'ASC',
     
    10491049        'authors' => ''
    10501050    );
    1051    
     1051
    10521052    $r = wp_parse_args( $args, $defaults );
    10531053    extract( $r );
  • trunk/wp-includes/query.php

    r5660 r5700  
    462462
    463463        $qv['attachment_id'] = (int) $qv['attachment_id'];
    464        
     464
    465465        if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
    466466            $this->is_single = true;
     
    10221022            if ( is_admin() )
    10231023                $where .= " OR post_status = 'future' OR post_status = 'draft'";
    1024            
     1024
    10251025            if ( is_user_logged_in() ) {
    10261026                $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'";
  • trunk/wp-includes/rewrite.php

    r5283 r5700  
    6464function url_to_postid($url) {
    6565    global $wp_rewrite;
    66    
     66
    6767    $url = apply_filters('url_to_postid', $url);
    6868
  • trunk/wp-includes/script-loader.php

    r5637 r5700  
    1212    function default_scripts() {
    1313        $this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' );
    14        
     14
    1515        $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' );
    16        
     16
    1717        $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
    18        
     18
    1919        $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
    2020        $this->localize( 'quicktags', 'quicktagsL10n', array(
     
    2929            'enterImageDescription' => __('Enter a description of the image')
    3030        ) );
    31        
     31
    3232        $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' );
    33        
     33
    3434        $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070528' );
    3535        $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php');
    3636        $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' );
    37        
     37
    3838        $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.1');
    39        
     39
    4040        $this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306');
    4141        $this->localize( 'autosave', 'autosaveL10n', array(
     
    4646            'savingText' => __('Saving Draft...')
    4747        ) );
    48        
     48
    4949        $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
    5050        $this->localize( 'wp-ajax', 'WPAjaxL10n', array(
     
    5454            'whoaText' => __("Slow down, I'm still sending your data!")
    5555        ) );
    56        
     56
    5757        $this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306' );
    5858        $this->localize( 'listman', 'listManL10n', array(
     
    6060            'delText' => __('Are you sure you want to delete this %thing%?')
    6161        ) );
    62        
     62
    6363        $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.1-b2');
    6464        $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.7.1-b2');
     
    6969        $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.7.1-b2');
    7070        $this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.7.1-b2');
    71        
     71
    7272        $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
    73        
     73
    7474        $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.2');
    7575        $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3');
    7676        $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2');
    77        
     77
    7878        if ( is_admin() ) {
    7979            global $pagenow;
     
    183183                    $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src;
    184184                    $src = $this->scripts[$handle]->src;
    185                    
     185
    186186                    if (!preg_match('|^https?://|', $src)) {
    187187                        $src = get_option('siteurl') . $src;
    188188                    }
    189                    
     189
    190190                    $src = add_query_arg('ver', $ver, $src);
    191191                    $src = clean_url(apply_filters( 'script_loader_src', $src ));
  • trunk/wp-includes/streams.php

    r4003 r5700  
    2929    return false;
    3030  }
    31  
     31
    3232  // should return new position
    3333  function seekto($position) {
    3434    return false;
    3535  }
    36  
     36
    3737  // returns current position
    3838  function currentpos() {
    3939    return false;
    4040  }
    41  
     41
    4242  // returns length of entire stream (limit for seekto()s)
    4343  function length() {
     
    115115      }
    116116      $this->_pos = ftell($this->_fd);
    117      
     117
    118118      return $data;
    119119    } else return '';
  • trunk/wp-includes/taxonomy.php

    r5658 r5700  
    9999        $wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'");
    100100    }
    101        
     101
    102102    $tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id");
    103103
     
    136136        wp_update_term_count($terms, $taxonomy);
    137137    }
    138    
     138
    139139    // TODO clear the cache
    140140}
     
    240240        $wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'");
    241241    }
    242        
     242
    243243    $tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id");
    244244
     
    301301    return $wpdb->get_row("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = '$taxonomy'", ARRAY_A);
    302302}
    303    
     303
    304304/**
    305305 * Given an array of terms, returns those that are defined term slugs.  Ignores integers.
     
    317317    return $wpdb->get_col("SELECT slug FROM $wpdb->terms WHERE slug IN ($terms)");
    318318}
    319    
     319
    320320/**
    321321 * Relates an object (post, link etc) to a term and taxonomy type.  Creates the term and taxonomy
     
    332332    if ( ! is_taxonomy($taxonomy) )
    333333        return false;
    334    
     334
    335335    if ( !is_array($terms) )
    336336        $terms = array($terms);
  • trunk/wp-includes/theme.php

    r5630 r5700  
    7171        'strong' => array()
    7272    );
    73    
     73
    7474    $theme_data = implode( '', file( $theme_file ) );
    7575    $theme_data = str_replace ( '\r', '\n', $theme_data );
     
    8080    preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri );
    8181    preg_match( '|Template:(.*)$|mi', $theme_data, $template );
    82    
     82
    8383    if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) )
    8484        $version = wp_kses( trim( $version[1] ), $themes_allowed_tags );
    8585    else
    8686        $version = '';
    87    
     87
    8888    if ( preg_match('|Status:(.*)|i', $theme_data, $status) )
    8989        $status = wp_kses( trim( $status[1] ), $themes_allowed_tags );
    9090    else
    9191        $status = 'publish';
    92    
     92
    9393    $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags );
    9494    $theme_uri = clean_url( trim( $theme_uri[1] ) );
    9595    $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
    9696    $template = wp_kses( trim( $template[1] ), $themes_allowed_tags );
    97    
     97
    9898    $author_uri = clean_url( trim( $author_uri[1] ) );
    99    
     99
    100100    if ( empty( $author_uri[1] ) ) {
    101101        $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags );
  • trunk/wp-includes/user.php

    r5587 r5700  
    189189        'selected' => 0, 'name' => 'user', 'class' => ''
    190190    );
    191    
     191
    192192    $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
    193    
     193
    194194    $r = wp_parse_args( $args, $defaults );
    195195    extract( $r );
  • trunk/wp-includes/vars.php

    r5446 r5700  
    3939    100 => 'Continue',
    4040    101 => 'Switching Protocols',
    41    
     41
    4242    200 => 'OK',
    4343    201 => 'Created',
     
    4747    205 => 'Reset Content',
    4848    206 => 'Partial Content',
    49    
     49
    5050    300 => 'Multiple Choices',
    5151    301 => 'Moved Permanently',
     
    5555    305 => 'Use Proxy',
    5656    307 => 'Temporary Redirect',
    57    
     57
    5858    400 => 'Bad Request',
    5959    401 => 'Unauthorized',
     
    7373    416 => 'Requested Range Not Satisfiable',
    7474    417 => 'Expectation Failed',
    75    
     75
    7676    500 => 'Internal Server Error',
    7777    501 => 'Not Implemented',
  • trunk/wp-includes/widgets.php

    r5688 r5700  
    6060function unregister_sidebar( $name ) {
    6161    global $wp_registered_sidebars;
    62        
     62
    6363    if ( isset( $wp_registered_sidebars[$name] ) )
    6464        unset( $wp_registered_sidebars[$name] );
     
    330330    extract( $args );
    331331    $options = get_option( 'widget_pages' );
    332    
     332
    333333    $title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title'];
    334334    $sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby'];
    335335    $exclude = empty( $options['exclude'] ) ? '' : '&exclude=' . $options['exclude'];
    336    
     336
    337337    if ( $sortby == 'menu_order' ) {
    338338        $sortby = 'menu_order, post_title';
    339339    }
    340    
     340
    341341    $out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby . $exclude );
    342    
     342
    343343    if ( !empty( $out ) ) {
    344344?>
     
    357357    if ( $_POST['pages-submit'] ) {
    358358        $newoptions['title'] = strip_tags(stripslashes($_POST['pages-title']));
    359        
     359
    360360        $sortby = stripslashes( $_POST['pages-sortby'] );
    361        
     361
    362362        if ( in_array( $sortby, array( 'post_title', 'menu_order', 'ID' ) ) ) {
    363363            $newoptions['sortby'] = $sortby;
     
    365365            $newoptions['sortby'] = 'menu_order';
    366366        }
    367        
     367
    368368        $newoptions['exclude'] = strip_tags( stripslashes( $_POST['pages-exclude'] ) );
    369369    }
     
    799799    wp_register_sidebar_widget('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments', $class);
    800800    wp_register_widget_control('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments_control', $dims);
    801    
     801
    802802    if ( is_active_widget('wp_widget_recent_comments') )
    803803        add_action('wp_head', 'wp_widget_recent_comments_style');
  • trunk/wp-includes/wp-db.php

    r5510 r5700  
    259259        if ( $query )
    260260            $this->query($query);
    261    
     261
    262262        if ( !isset($this->last_result[$y]) )
    263263            return null;
     
    373373        if ( !$this->show_errors )
    374374            return false;
    375        
     375
    376376        header('Content-Type: text/html; charset=utf-8');
    377377
  • trunk/wp-mail.php

    r5396 r5700  
    118118    }
    119119    $content = trim($content);
    120    
     120
    121121    if (stripos($content_transfer_encoding, "quoted-printable") !== false) {
    122122        $content = quoted_printable_decode($content);
  • trunk/wp-settings.php

    r5690 r5700  
    147147    else
    148148        $link = 'wp-admin/install.php';
    149    
     149
    150150    wp_die( sprintf( 'It doesn&#8217;t look like you&#8217;ve installed WP yet. Try running <a href="%s">install.php</a>.', $link ) );
    151151}
  • trunk/xmlrpc.php

    r5671 r5700  
    506506            $category["description"] = "";
    507507        }
    508    
     508
    509509        $new_category = array(
    510510            "cat_name"              => $category["name"],
     
    785785        return $this->error;
    786786      }
    787      
     787
    788788      $cap = ($publish) ? 'publish_posts' : 'edit_posts';
    789789      $user = set_current_user(0, $user_login);
     
    12171217        $comment_status = (int) $content_struct["mt_allow_comments"];
    12181218      }
    1219      
     1219
    12201220      // Do some timestamp voodoo
    12211221      $dateCreatedd = $content_struct['dateCreated'];
Note: See TracChangeset for help on using the changeset viewer.