Make WordPress Core

Changeset 10810


Ignore:
Timestamp:
03/18/2009 02:43:45 AM (18 years ago)
Author:
ryan
Message:

Trim trailing whitespace

Location:
trunk
Files:
42 edited

Legend:

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

    r10605 r10810  
    279279
    280280if ( 'spam' == $comment_status ) {
    281         wp_nonce_field('bulk-spam-delete', '_spam_nonce'); 
     281        wp_nonce_field('bulk-spam-delete', '_spam_nonce');
    282282        if ( current_user_can ('moderate_comments')) { ?>
    283283                <input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
  • trunk/wp-admin/edit-form-advanced.php

    r10787 r10810  
    270270 */
    271271function post_tags_meta_box($post, $box) {
    272         $tax_name = substr($box['id'], 8); 
     272        $tax_name = substr($box['id'], 8);
    273273        $taxonomy = get_taxonomy($tax_name);
    274274        $helps = isset($taxonomy->helps) ? attribute_escape($taxonomy->helps) : __('Separate tags with commas.');
    275275?>
    276 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> 
     276<div class="tagsdiv" id="<?php echo $tax_name; ?>">
    277277        <p class="jaxtag">
    278278                <label class="hidden" for="newtag"><?php _e( $box['title'] ); ?></label>
    279                 <input type="hidden" name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]" value="<?php echo get_terms_to_edit( $post->ID, $tax_name ); ?>" /> 
    280          
     279                <input type="hidden" name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]" value="<?php echo get_terms_to_edit( $post->ID, $tax_name ); ?>" />
     280
    281281        <span class="ajaxtag">
    282282                <input type="text" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php _e('Add new tag'); ?>" />
    … …  
    284284        </span></p>
    285285        <p class="howto"><?php echo $helps; ?></p>
    286         <div class="tagchecklist"></div> 
    287 </div> 
     286        <div class="tagchecklist"></div>
     287</div>
    288288<p class="tagcloud-link hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p>
    289289<?php
    290290}
    291291
    292 // all tag-style post taxonomies 
    293 foreach ( get_object_taxonomies('post') as $tax_name ) { 
    294         if ( !is_taxonomy_hierarchical($tax_name) ) { 
     292// all tag-style post taxonomies
     293foreach ( get_object_taxonomies('post') as $tax_name ) {
     294        if ( !is_taxonomy_hierarchical($tax_name) ) {
    295295                $taxonomy = get_taxonomy($tax_name);
    296296                $label = isset($taxonomy->label) ? attribute_escape($taxonomy->label) : $tax_name;
    297297
    298                 add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', 'post', 'side', 'core'); 
    299         } 
    300 } 
     298                add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', 'post', 'side', 'core');
     299        }
     300}
    301301
    302302/**
  • trunk/wp-admin/import/livejournal.php

    r10647 r10810  
    3131        var $commentmap;
    3232        var $pointers = array();
    33        
     33
    3434        // This list taken from LJ, they don't appear to have an API for it
    3535        var $moods = array( '1' => 'aggravated',
    … …  
    194194                        <p><?php _e( 'Howdy! This importer allows you to connect directly to LiveJournal and download all your entries and comments' ) ?></p>
    195195                        <p><?php _e( 'Enter your LiveJournal username and password below so we can connect to your account:' ) ?></p>
    196                
     196
    197197                        <table class="form-table">
    198198
    … …  
    206206                        <td><input type="password" name="lj_password" id="lj_password" class="regular-text" /></td>
    207207                        </tr>
    208      
     208
    209209                        </table>
    210      
     210
    211211                        <p><?php _e( 'If you have any entries on LiveJournal which are marked as private, they will be password-protected when they are imported so that only people who know the password can see them.' ) ?></p>
    212212                        <p><?php _e( "If you don't enter a password, ALL ENTRIES from your LiveJournal will be imported as public posts in WordPress." ) ?></p>
    … …  
    222222
    223223                        <p><?php _e( "<strong>WARNING:</strong> This can take a really long time if you have a lot of entries in your LiveJournal, or a lot of comments. Ideally, you should only start this process if you can leave your computer alone while it finishes the import." ) ?></p>
    224                
     224
    225225                        <p class="submit">
    226226                                <input type="submit" class="button-primary" value="<?php echo attribute_escape( __( 'Connect to LiveJournal and Import' ) ) ?>" />
    227227                        </p>
    228                
     228
    229229                        <p><?php _e( '<strong>NOTE:</strong> If the import process is interrupted for <em>any</em> reason, come back to this page and it will continue from where it stopped automatically.' ) ?></p>
    230230
    … …  
    237237                <?php
    238238        }
    239        
     239
    240240        function download_post_meta() {
    241241                $total           = (int) get_option( 'ljapi_total' );
    … …  
    248248                if ( !is_array( $sync_item_times ) )
    249249                        $sync_item_times = array();
    250                
     250
    251251                do {
    252252                        $lastsync = date( 'Y-m-d H:i:s', strtotime( get_option( 'ljapi_lastsync' ) ) );
    … …  
    254254                        if ( is_wp_error( $synclist ) )
    255255                                return $synclist;
    256                                
     256
    257257                        // Keep track of if we've downloaded everything
    258258                        $total = $synclist['total'];
    259259                        $count = $synclist['count'];
    260                
     260
    261261                        foreach ( $synclist['syncitems'] as $event ) {
    262262                                if ( substr( $event['item'], 0, 2 ) == 'L-' ) {
    … …  
    277277                echo '<p>' . __( 'Post metadata has been downloaded, proceeding with posts...' ) . '</p>';
    278278        }
    279        
     279
    280280        function download_post_bodies() {
    281281                $imported_count  = (int) get_option( 'ljapi_imported_count' );
    … …  
    286286
    287287                $count = 0;
    288                 echo '<ol>';           
     288                echo '<ol>';
    289289                do {
    290290                        $lastsync = date( 'Y-m-d H:i:s', strtotime( get_option( 'ljapi_lastsync_posts' ) ) );
    291                        
     291
    292292                        // Get the batch of items that match up with the syncitems list
    293293                        $itemlist = $this->lj_ixr( 'getevents', array( 'ver' => 1,
    … …  
    297297                        if ( is_wp_error( $itemlist ) )
    298298                                return $itemlist;
    299                        
     299
    300300                        if ( $num = count( $itemlist['events'] ) ) {
    301301                                for ( $e = 0; $e < count( $itemlist['events'] ); $e++ ) {
    … …  
    315315                        $count++;
    316316                } while ( $num > 0 && $count < 3 ); // Doing up to 3 requests at a time to avoid memory problems
    317                
     317
    318318                // Used so that step1 knows when to stop posting back on itself
    319319                update_option( 'ljapi_last_sync_count', $num );
    320                
     320
    321321                // Counter just used to show progress to user
    322322                update_option( 'ljapi_post_batch', ( (int) get_option( 'ljapi_post_batch' ) + 1 ) );
    … …  
    324324                echo '</ol>';
    325325        }
    326        
     326
    327327        function import_post( $post ) {
    328328                global $wpdb;
    329                
     329
    330330                // Make sure we haven't already imported this one
    331331                if ( $this->get_wp_post_ID( $post['itemid'] ) )
    332332                        return;
    333                
     333
    334334                $user = wp_get_current_user();
    335335                $post_author      = $user->ID;
    … …  
    342342                if ( 18 == strlen( $post_date ) )
    343343                        $post_date = substr( $post_date, 0, 10 ) . ' ' . substr( $post_date, 10 );
    344                
     344
    345345                // Cleaning up and linking the title
    346346                $post_title = isset( $post['subject'] ) ? trim( $post['subject'] ) : '';
    … …  
    348348                $post_title = strip_tags( $post_title ); // Can't have tags in the title in WP
    349349                $post_title = $wpdb->escape( $post_title );
    350                
     350
    351351                // Clean up content
    352352                $post_content = $post['event'];
    … …  
    364364                $post_content = force_balance_tags( $post_content );
    365365                $post_content = $wpdb->escape( $post_content );
    366                
     366
    367367                // Handle any tags associated with the post
    368368                $tags_input = !empty( $post['props']['taglist'] ) ? $post['props']['taglist'] : '';
    369                
     369
    370370                // Check if comments are closed on this post
    371371                $comment_status = !empty( $post['props']['opt_nocomments'] ) ? 'closed' : 'open';
    … …  
    388388                                return new WP_Error( 'insert_post_failed', __( 'Failed to create post.' ) );
    389389                        }
    390                        
     390
    391391                        // Handle all the metadata for this post
    392392                        $this->insert_postmeta( $post_id, $post );
    … …  
    394394                echo '</li>';
    395395        }
    396        
     396
    397397        // Convert lj-user tags to links to that user
    398398        function translate_lj_user( $str ) {
    399399                return preg_replace( '|<lj\s+user\s*=\s*["\']([\w-]+)["\']>|', '<a href="http://$1.livejournal.com/" class="lj-user">$1</a>', $str );
    400400        }
    401        
     401
    402402        function insert_postmeta( $post_id, $post ) {
    403403                // Need the original LJ id for comments
    404404                add_post_meta( $post_id, 'lj_itemid', $post['itemid'] );
    405                
     405
    406406                // And save the permalink on LJ in case we want to link back or something
    407407                add_post_meta( $post_id, 'lj_permalink', $post['url'] );
    408                
     408
    409409                // Supports the following "props" from LJ, saved as lj_<prop_name> in wp_postmeta
    410410                //              Adult Content - adult_content
    … …  
    425425                }
    426426        }
    427        
     427
    428428        // Set up a session (authenticate) with LJ
    429429        function get_session() {
    … …  
    434434                return new WP_Http_Cookie( array( 'name' => 'ljsession', 'value' => $cookie['ljsession'] ) );
    435435        }
    436        
     436
    437437        // Loops through and gets comment meta from LJ in batches
    438438        function download_comment_meta() {
    … …  
    440440                if ( is_wp_error( $cookie ) )
    441441                        return $cookie;
    442                
     442
    443443                // Load previous state (if any)
    444444                $this->usermap = (array) get_option( 'ljapi_usermap' );
    445445                $maxid         = get_option( 'ljapi_maxid' ) ? get_option( 'ljapi_maxid' ) : 1;
    446446                $highest_id    = get_option( 'ljapi_highest_id' ) ? get_option( 'ljapi_highest_id' ) : 0;
    447                
     447
    448448                // We need to loop over the metadata request until we have it all
    449449                while ( $maxid > $highest_id ) {
    … …  
    453453                        if ( is_wp_error( $results ) )
    454454                                return new WP_Error( 'comment_meta', __( 'Failed to retrieve comment meta information from LiveJournal. Please try again soon.' ) );
    455                        
     455
    456456                        $results = wp_remote_retrieve_body( $results );
    457                        
     457
    458458                        // Get the maxid so we know if we have them all yet
    459459                        preg_match( '|<maxid>(\d+)</maxid>|', $results, $matches );
    … …  
    466466                        }
    467467                        $maxid = !empty( $matches[1] ) ? $matches[1] : $maxid;
    468                        
     468
    469469                        // Parse comments and get highest id available
    470470                        preg_match_all( '|<comment id=\'(\d+)\'|is', $results, $matches );
    … …  
    478478                        foreach ( $matches[1] as $count => $userid )
    479479                                $this->usermap[$userid] = $matches[2][$count]; // need this in memory for translating ids => names
    480                                
     480
    481481                        wp_cache_flush();
    482482                }
    … …  
    486486                update_option( 'ljapi_maxid',      $maxid );
    487487                update_option( 'ljapi_highest_id', $highest_id );
    488                
     488
    489489                echo '<p>' . __( ' Comment metadata downloaded successfully, proceeding with comment bodies...' ) . '</p>';
    490                
     490
    491491                return true;
    492492        }
    493        
     493
    494494        // Downloads actual comment bodies from LJ
    495495        // Inserts them all directly to the DB, with additional info stored in "spare" fields
    … …  
    499499                if ( is_wp_error( $cookie ) )
    500500                        return $cookie;
    501                
     501
    502502                // Load previous state (if any)
    503503                $this->usermap = (array) get_option( 'ljapi_usermap' );
    … …  
    507507                while ( $maxid > $highest_id && $loop < 5 ) { // We do 5 loops per call to avoid memory limits
    508508                        $loop++;
    509                        
     509
    510510                        // Get a batch of comments, using the highest_id we've already got as a starting point
    511511                        $results = wp_remote_get( $this->comments_url . '?get=comment_body&startid=' . ( $highest_id + 1 ),
    … …  
    513513                        if ( is_wp_error( $results ) )
    514514                                return new WP_Error( 'comment_bodies', __( 'Failed to retrieve comment bodies from LiveJournal. Please try again soon.' ) );
    515                        
     515
    516516                        $results = wp_remote_retrieve_body( $results );
    517                        
     517
    518518                        // Parse out each comment and insert directly
    519519                        preg_match_all( '|<comment id=\'(\d+)\'.*</comment>|iUs', $results, $matches );
    … …  
    524524                                        update_option( 'ljapi_highest_comment_id', $highest_id );
    525525                                }
    526                                        
     526
    527527                                $comment = $matches[0][$c];
    528528
    … …  
    537537                                clean_comment_cache( $id );
    538538                        }
    539                        
     539
    540540                        // Clear cache to preseve memory
    541541                        wp_cache_flush();
    542542                }
    543543                // endwhile - all comments downloaded and ready for bulk processing
    544                
     544
    545545                // Counter just used to show progress to user
    546546                update_option( 'ljapi_comment_batch', ( (int) get_option( 'ljapi_comment_batch' ) + 1 ) );
    547                
     547
    548548                return true;
    549549        }
    550        
     550
    551551        // Takes a block of XML and parses out all the elements of the comment
    552552        function parse_comment( $comment ) {
    553553                global $wpdb;
    554                
     554
    555555                // Get the top-level attributes
    556556                preg_match( '|<comment([^>]+)>|i', $comment, $attribs );
    … …  
    565565                preg_match( '| state=\'([SDFA])\'|i', $attribs[1], $matches ); // optional
    566566                $lj_comment_state = isset( $matches[1] ) ? $matches[1] : 'A';
    567                
     567
    568568                // Clean up "subject" - this will become the first line of the comment in WP
    569569                preg_match( '|<subject>(.*)</subject>|is', $comment, $matches );
    … …  
    573573                                $comment_subject = '';
    574574                }
    575                
     575
    576576                // Get the body and HTMLize it
    577577                preg_match( '|<body>(.*)</body>|is', $comment, $matches );
    … …  
    584584                $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $comment_content );
    585585                $comment_content = $wpdb->escape( trim( $comment_content ) );
    586                
     586
    587587                // Get and convert the date
    588588                preg_match( '|<date>(.*)</date>|i', $comment, $matches );
    589589                $comment_date = trim( str_replace( array( 'T', 'Z' ), ' ', $matches[1] ) );
    590                
     590
    591591                // Grab IP if available
    592592                preg_match( '|<property name=\'poster_ip\'>(.*)</property>|i', $comment, $matches ); // optional
    593593                $comment_author_IP = isset( $matches[1] ) ? $matches[1] : '';
    594                
     594
    595595                // Try to get something useful for the comment author, especially if it was "my" comment
    596596                $author = ( empty( $comment_author_ID ) || empty( $this->usermap[$comment_author_ID] ) || substr( $this->usermap[$comment_author_ID], 0, 4 ) == 'ext_' ) ? __( 'Anonymous' ) : $this->usermap[$comment_author_ID];
    … …  
    602602                } else {
    603603                        $user_id = 0;
    604                         $url     = ( __( 'Anonymous' ) == $author ) ? '' : 'http://' . $author . '.livejournal.com/';                   
    605                 }
    606                
     604                        $url     = ( __( 'Anonymous' ) == $author ) ? '' : 'http://' . $author . '.livejournal.com/';
     605                }
     606
    607607                // Send back the array of details
    608608                return array( 'lj_comment_ID' => $lj_comment_ID,
    … …  
    624624                                        );
    625625        }
    626        
    627        
     626
     627
    628628        // Gets the post_ID that a LJ post has been saved as within WP
    629629        function get_wp_post_ID( $post ) {
    630630                global $wpdb;
    631                
     631
    632632                if ( empty( $this->postmap[$post] ) )
    633633                        $this->postmap[$post] = (int) $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'lj_itemid' AND meta_value = %d", $post ) );
    634                
     634
    635635                return $this->postmap[$post];
    636636        }
    637        
     637
    638638        // Gets the comment_ID that a LJ comment has been saved as within WP
    639639        function get_wp_comment_ID( $comment ) {
    … …  
    643643                return $this->commentmap[$comment];
    644644        }
    645                        
     645
    646646        function lj_ixr() {
    647647                if ( $challenge = $this->ixr->query( 'LJ.XMLRPC.getchallenge' ) ) {
    … …  
    656656                        return new WP_Error( 'IXR', __( 'LiveJournal is not responding to authentication requests. Please wait a while and then try again.' ) );
    657657                }
    658                
     658
    659659                $args = func_get_args();
    660660        $method = array_shift( $args );
    … …  
    667667                }
    668668        }
    669        
     669
    670670        function dispatch() {
    671671                if ( empty( $_REQUEST['step'] ) )
    … …  
    675675
    676676                $this->header();
    677                
     677
    678678                switch ( $step ) {
    679679                        case -1 :
    … …  
    712712                        $this->password = get_option( 'ljapi_password' );
    713713                }
    714        
     714
    715715                // This is the password to set on protected posts
    716716                if ( !empty( $_POST['protected_password'] ) ) {
    … …  
    720720                        $this->protected_password = get_option( 'ljapi_protected_password' );
    721721                }
    722                
     722
    723723                // Login to confirm the details are correct
    724724                if ( empty( $this->username ) || empty( $this->password ) ) {
    … …  
    746746                        update_option( 'ljapi_verified', 'yes' );
    747747                }
    748                
     748
    749749                // Set up some options to avoid them autoloading (these ones get big)
    750750                add_option( 'ljapi_sync_item_times',  '', '', 'no' );
    751751                add_option( 'ljapi_usermap',          '', '', 'no' );
    752752                update_option( 'ljapi_comment_batch', 0 );
    753                
     753
    754754                return true;
    755755        }
    … …  
    776776                        }
    777777                }
    778                
     778
    779779                echo '<div id="ljapi-status">';
    780780                echo '<h3>' . __( 'Importing Posts' ) . '</h3>';
    … …  
    786786                }
    787787                ob_flush(); flush();
    788                
     788
    789789                if ( !get_option( 'ljapi_lastsync' ) || '1900-01-01 00:00:00' == get_option( 'ljapi_lastsync' ) ) {
    790790                        // We haven't downloaded meta yet, so do that first
    … …  
    828828                echo '</div>';
    829829        }
    830        
     830
    831831        // Download comments to local XML
    832832        function step2() {
    … …  
    836836                $this->password = get_option( 'ljapi_password' );
    837837                $this->ixr = new IXR_Client( $this->ixr_url, false, 80, 30 );
    838                
     838
    839839                echo '<div id="ljapi-status">';
    840840                echo '<h3>' . __( 'Downloading Comments' ) . '</h3>';
    841841                echo '<p>' . __( 'Now we will download your comments so we can import them (this could take a <strong>long</strong> time if you have lots of comments)...' ) . '</p>';
    842842                ob_flush(); flush();
    843                
     843
    844844                if ( !get_option( 'ljapi_usermap' ) ) {
    845845                        // We haven't downloaded meta yet, so do that first
    … …  
    878878                echo '</div>';
    879879        }
    880        
     880
    881881        // Re-thread comments already in the DB
    882882        function step3() {
    … …  
    884884                set_time_limit( 0 );
    885885                update_option( 'ljapi_step', 3 );
    886                
     886
    887887                echo '<div id="ljapi-status">';
    888888                echo '<h3>' . __( 'Threading Comments' ) . '</h3>';
    889889                echo '<p>' . __( 'We are now re-building the threading of your comments (this can also take a while if you have lots of comments)...' ) . '</p>';
    890890                ob_flush(); flush();
    891                
     891
    892892                // Only bother adding indexes if they have over 5000 comments (arbitrary number)
    893893                $imported_comments = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_type = 'livejournal'" );
    … …  
    900900                        add_clean_index( $wpdb->comments, 'comment_agent' );
    901901                }
    902                
     902
    903903                // Get LJ comments, which haven't been threaded yet, 5000 at a time and thread them
    904904                while ( $comments = $wpdb->get_results( "SELECT comment_ID, comment_agent FROM {$wpdb->comments} WHERE comment_type = 'livejournal' AND comment_agent != '0' LIMIT 5000", OBJECT ) ) {
    905905                        foreach ( $comments as $comment ) {
    906                                 $wpdb->update( $wpdb->comments, 
    907                                                                 array( 'comment_parent' => $this->get_wp_comment_ID( $comment->comment_agent ), 'comment_type' => 'livejournal-done' ), 
     906                                $wpdb->update( $wpdb->comments,
     907                                                                array( 'comment_parent' => $this->get_wp_comment_ID( $comment->comment_agent ), 'comment_type' => 'livejournal-done' ),
    908908                                                                array( 'comment_ID' => $comment->comment_ID ) );
    909909                        }
    … …  
    911911                        $wpdb->flush();
    912912                }
    913                
     913
    914914                // Revert the comments table back to normal and optimize it to reclaim space
    915915                if ( $added_indices ) {
    … …  
    919919                        $wpdb->query( "OPTIMIZE TABLE {$wpdb->comments}" );
    920920                }
    921                
     921
    922922                // Clean up database and we're out
    923923                $this->cleanup();
    … …  
    930930                echo '</div>';
    931931        }
    932        
     932
    933933        // Output an error message with a button to try again.
    934934        function throw_error( $error, $step ) {
    … …  
    936936                echo $this->next_step( $step, __( 'Try Again' ) );
    937937        }
    938        
     938
    939939        // Returns the HTML for a link to the next page
    940940        function next_step( $next_step, $label, $id = 'ljapi-next-form' ) {
    … …  
    945945                $str .= '<p><input type="submit" class="button-primary" value="' . attribute_escape( $label ) . '" /> <span id="auto-message"></span></p>';
    946946                $str .= '</form>';
    947                
     947
    948948                return $str;
    949949        }
    950        
     950
    951951        // Automatically submit the specified form after $seconds
    952952        // Include a friendly countdown in the element with id=$msg
    … …  
    957957                                ljapi_msg();
    958958                        });
    959                        
     959
    960960                        function ljapi_msg() {
    961961                                str = '<?php _e( "Continuing in %d" ) ?>';
    … …  
    975975                </script><?php
    976976        }
    977        
     977
    978978        // Automatically submit the form with #id to continue the process
    979979        // Hide any submit buttons to avoid people clicking them
    … …  
    985985                                ljapi_msg();
    986986                        });
    987                        
     987
    988988                        function ljapi_msg() {
    989989                                str = '<?php _e( "Continuing in %d" ) ?>';
    … …  
    10121012        function cleanup() {
    10131013                global $wpdb;
    1014                
     1014
    10151015                delete_option( 'ljapi_username' );
    10161016                delete_option( 'ljapi_password' );
    … …  
    10311031                delete_option( 'ljapi_comment_batch' );
    10321032                delete_option( 'ljapi_step' );
    1033                
    1034                 $wpdb->update( $wpdb->comments, 
    1035                                                 array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ), 
     1033
     1034                $wpdb->update( $wpdb->comments,
     1035                                                array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ),
    10361036                                                array( 'comment_type' => 'livejournal-done' ) );
    1037                 $wpdb->update( $wpdb->comments, 
    1038                                                 array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ), 
     1037                $wpdb->update( $wpdb->comments,
     1038                                                array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ),
    10391039                                                array( 'comment_type' => 'livejournal' ) );
    10401040        }
    1041        
     1041
    10421042        function LJ_API_Import() {
    10431043                $this->__construct();
    10441044        }
    1045        
     1045
    10461046        function __construct() {
    10471047                // Nothing
  • trunk/wp-admin/import/mt.php

    r10609 r10810  
    439439                        } else {
    440440                                // Processing multi-line field, check context.
    441                                
     441
    442442                                if( !empty($line) )
    443443                                        $line .= "\n";
    444                                        
     444
    445445                                if ( 'body' == $context ) {
    446446                                        $post->post_content .= $line;
  • trunk/wp-admin/includes/dashboard.php

    r10743 r10810  
    168168        echo "\t<div class='postbox-container' style='$width'>\n";
    169169        do_meta_boxes( 'dashboard', 'normal', '' );
    170        
     170
    171171        echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
    172172        do_meta_boxes( 'dashboard', 'side', '' );
  • trunk/wp-admin/includes/file.php

    r10628 r10810  
    714714                jQuery("#ssh_keys").hide();
    715715        });
    716         jQuery('form input[value=""]:first').focus(); 
     716        jQuery('form input[value=""]:first').focus();
    717717});
    718718-->
  • trunk/wp-admin/includes/media.php

    r10793 r10810  
    15501550</script>
    15511551<div id="sort-buttons" class="hide-if-no-js">
    1552 <?php _e('Sort Order:'); ?> 
    1553 <a href="#" id="asc"><?php _e('Ascending'); ?></a> 
    1554 <a href="#" id="desc"><?php _e('Descending'); ?></a> 
     1552<?php _e('Sort Order:'); ?>
     1553<a href="#" id="asc"><?php _e('Ascending'); ?></a>
     1554<a href="#" id="desc"><?php _e('Descending'); ?></a>
    15551555<a href="#" id="clear"><?php _e('Clear'); ?></a>
    15561556</div>
  • trunk/wp-admin/includes/misc.php

    r10643 r10810  
    242242        if ( !is_string( $content ) || empty( $content ) )
    243243                return array();
    244                
     244
    245245        $tokens = token_get_all( $content );
    246246        $functions = array();
    … …  
    257257                }
    258258        }
    259        
     259
    260260        $functions = array_unique( $functions );
    261261        sort( $functions );
    262262        $ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions );
    263263        $ignore_functions = array_unique( $ignore_functions );
    264        
     264
    265265        $out = array();
    266266        foreach ( $functions as $function ) {
    … …  
    269269                $out[] = $function;
    270270        }
    271        
     271
    272272        return $out;
    273273}
    … …  
    276276 * Determines the language to use for CodePress syntax highlighting,
    277277 * based only on a filename.
    278  * 
     278 *
    279279 * @since 2.8
    280  * 
     280 *
    281281 * @param string $filename The name of the file to be highlighting
    282282**/
    283283function codepress_get_lang( $filename ) {
    284         $codepress_supported_langs = apply_filters( 'codepress_supported_langs', 
     284        $codepress_supported_langs = apply_filters( 'codepress_supported_langs',
    285285                                                                        array( '.css' => 'css',
    286                                                                                         '.js' => 'javascript', 
    287                                                                                         '.php' => 'php', 
    288                                                                                         '.html' => 'html', 
    289                                                                                         '.htm' => 'html', 
    290                                                                                         '.txt' => 'text' 
     286                                                                                        '.js' => 'javascript',
     287                                                                                        '.php' => 'php',
     288                                                                                        '.html' => 'html',
     289                                                                                        '.htm' => 'html',
     290                                                                                        '.txt' => 'text'
    291291                                                                                        ) );
    292292        $extension = substr( $filename, strrpos( $filename, '.' ) );
    293293        if ( $extension && array_key_exists( $extension, $codepress_supported_langs ) )
    294294                return $codepress_supported_langs[$extension];
    295        
     295
    296296        return 'generic';
    297297}
    … …  
    299299/**
    300300 * Adds Javascript required to make CodePress work on the theme/plugin editors.
    301  * 
     301 *
    302302 * This code is attached to the action admin_print_footer_scripts.
    303  * 
     303 *
    304304 * @since 2.8
    305305**/
  • trunk/wp-admin/includes/post.php

    r10791 r10810  
    412412
    413413        $post_title = stripslashes( sanitize_post_field( 'post_title', $title, 0, 'db' ) );
    414         $post_content = stripslashes( sanitize_post_field( 'post_content', $content, 0, 'db' ) );   
     414        $post_content = stripslashes( sanitize_post_field( 'post_content', $content, 0, 'db' ) );
    415415        $post_date = stripslashes( sanitize_post_field( 'post_date', $date, 0, 'db' ) );
    416416
    … …  
    432432                $args[] = $post_content;
    433433        }
    434    
     434
    435435        if ( !empty ( $args ) )
    436436                return $wpdb->get_var( $wpdb->prepare($query, $args) );
    … …  
    925925        }
    926926
    927         $post->filter = 'sample'; 
     927        $post->filter = 'sample';
    928928
    929929        $permalink = get_permalink($post, true);
    … …  
    964964        if ( 'publish' == $post->post_status )
    965965                $view_post = 'post' == $post->post_type ? __('View Post') : __('View Page');
    966        
     966
    967967        if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
    968968                $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n";
    … …  
    11451145function wp_tiny_mce( $teeny = false ) {
    11461146        global $concatenate_scripts, $compress_scripts;
    1147        
     1147
    11481148        if ( ! user_can_richedit() )
    11491149                return;
  • trunk/wp-admin/includes/schema.php

    r10774 r10810  
    329329                $value = $wpdb->escape($value);
    330330                if ( !empty($insert) )
    331                         $insert .= ', '; 
     331                        $insert .= ', ';
    332332                $insert .= "('$option', '$value', '$autoload')";
    333333        }
  • trunk/wp-admin/includes/taxonomy.php

    r10222 r10810  
    219219        if ( is_wp_error($tags) )
    220220                return $tags;
    221        
     221
    222222        foreach ( $tags as $tag )
    223223                $tag_names[] = $tag->name;
  • trunk/wp-admin/includes/template.php

    r10788 r10810  
    369369 *
    370370 * Compares the first two arguments and if identical marks as checked
    371  * 
     371 *
    372372 * @since unknown
    373373 *
    … …  
    382382/**
    383383 * Outputs the html selected attribute.
    384  * 
     384 *
    385385 * Compares the first two arguments and if identical marks as selected
    386386 *
    … …  
    397397/**
    398398 * Private helper function for checked and selected.
    399  * 
     399 *
    400400 * Compares the first two arguments and if identical marks as $type
    401401 *
    … …  
    413413        else
    414414                $result = '';
    415        
     415
    416416        if ($echo)
    417417                echo $result;
    418        
     418
    419419        return $result;
    420420}
    … …  
    27522752        if ( ! empty( $upload_dir['error'] ) ) :
    27532753                ?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
    2754                 <p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php 
    2755         else : 
     2754                <p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
     2755        else :
    27562756?>
    27572757<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attribute_escape($action) ?>">
    … …  
    34743474                return '';
    34753475        }
    3476        
     3476
    34773477        if ( ! $screen_layout_columns )
    34783478                        $screen_layout_columns = 2;
  • trunk/wp-admin/includes/theme-install.php

    r10788 r10810  
    1919        'tags' => true, 'num_ratings' => true
    2020);
    21  
     21
    2222
    2323/**
    … …  
    303303<p><strong><?php _e('Version:') ?></strong> <?php echo wp_kses($theme->version, $themes_allowedtags) ?></p>
    304304<p><strong><?php _e('Author:') ?></strong> <?php echo wp_kses($theme->author, $themes_allowedtags) ?></p>
    305 <?php if ( ! empty($theme->last_updated) ) : ?> 
     305<?php if ( ! empty($theme->last_updated) ) : ?>
    306306<p><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $theme->last_updated ?>"><?php printf( __('%s ago'), human_time_diff(strtotime($theme->last_updated)) ) ?></span></p>
    307 <?php endif; if ( ! empty($theme->requires) ) : ?>               
    308 <p><strong><?php _e('Requires WordPress Version:') ?></strong> <?php printf(__('%s or higher'), $theme->requires) ?></p>                 
    309 <?php endif; if ( ! empty($theme->tested) ) : ?>                 
    310 <p><strong><?php _e('Compatible up to:') ?></strong> <?php echo $theme->tested ?></p>                   
     307<?php endif; if ( ! empty($theme->requires) ) : ?>
     308<p><strong><?php _e('Requires WordPress Version:') ?></strong> <?php printf(__('%s or higher'), $theme->requires) ?></p>
     309<?php endif; if ( ! empty($theme->tested) ) : ?>
     310<p><strong><?php _e('Compatible up to:') ?></strong> <?php echo $theme->tested ?></p>
    311311<?php endif; if ( !empty($theme->downloaded) ) : ?>
    312312<p><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $theme->downloaded), number_format_i18n($theme->downloaded)) ?></p>
    … …  
    844844                return new WP_Error('install_folder_exists', __('Folder already exists.'), $filelist[0] );
    845845        }
    846        
     846
    847847        apply_filters('install_feedback', __('Installing the theme'));
    848848        // Copy new version of theme into place.
  • trunk/wp-admin/includes/upgrade.php

    r10767 r10810  
    9797        /* translators: Default category slug */
    9898        $cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug'));
    99        
     99
    100100        $wpdb->insert( $wpdb->terms, array('name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) );
    101101        $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => '1', 'taxonomy' => 'category', 'description' => '', 'parent' => 0, 'count' => 1));
    … …  
    105105        /* translators: Default link category slug */
    106106        $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug'));
    107        
     107
    108108        $wpdb->insert( $wpdb->terms, array('name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) );
    109109        $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => '2', 'taxonomy' => 'link_category', 'description' => '', 'parent' => 0, 'count' => 7));
    … …  
    118118
    119119        $default_links[] = array(       'link_url' => 'http://wordpress.org/development/',
    120                                                                 'link_name' => 'Development Blog', 
     120                                                                'link_name' => 'Development Blog',
    121121                                                                'link_category' => 0,
    122122                                                                'link_rss' => 'http://wordpress.org/development/feed/',
    … …  
    162162        $now_gmt = gmdate('Y-m-d H:i:s');
    163163        $first_post_guid = get_option('home') . '/?p=1';
    164        
     164
    165165        $wpdb->insert( $wpdb->posts, array(
    166166                                                                'post_author' => $user_id,
    … …  
    177177                                                                'guid' => $first_post_guid,
    178178                                                                'comment_count' => 1,
    179                                                                 'to_ping' => '', 
     179                                                                'to_ping' => '',
    180180                                                                'pinged' => '',
    181181                                                                'post_content_filtered' => ''
    … …  
    209209                                                                'guid' => $first_post_guid,
    210210                                                                'post_type' => 'page',
    211                                                                 'to_ping' => '', 
     211                                                                'to_ping' => '',
    212212                                                                'pinged' => '',
    213213                                                                'post_content_filtered' => ''
    … …  
    519519                        $comment_content = deslash($comment->comment_content);
    520520                        $comment_author = deslash($comment->comment_author);
    521                        
     521
    522522                        $wpdb->update($wpdb->comments, compact('comment_content', 'comment_author'), array('comment_ID' => $comment->comment_ID) );
    523523                }
    … …  
    530530                        $link_name = deslash($link->link_name);
    531531                        $link_description = deslash($link->link_description);
    532                        
     532
    533533                        $wpdb->update( $wpdb->links, compact('link_name', 'link_description'), array('link_id' => $link->link_id) );
    534534                }
    … …  
    642642                foreach ($objects as $object) {
    643643                        $wpdb->update( $wpdb->posts, array(     'post_status' => 'attachment',
    644                                                                                                 'post_mime_type' => $object->post_type, 
     644                                                                                                'post_mime_type' => $object->post_type,
    645645                                                                                                'post_type' => ''),
    646646                                                                                 array( 'ID' => $object->ID ) );
  • trunk/wp-admin/includes/user.php

    r10760 r10810  
    1111 *
    1212 * It seems that the first half is for backwards compatibility, but only
    13  * has the ability to alter the user's role. Wordpress core seems to 
     13 * has the ability to alter the user's role. Wordpress core seems to
    1414 * use this function only in the second way, running edit_user() with
    1515 * no id so as to create a new user.
    … …  
    3232                                if (!$editable_roles[$_POST['role']])
    3333                                        wp_die(__('You can&#8217;t give users that role.'));
    34                                
     34
    3535                                $user = new WP_User( $user_id );
    3636                                $user->set_role( $_POST['role'] );
    … …  
    7878                // Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
    7979                if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ))
    80                         $user->role = $_POST['role']; 
     80                        $user->role = $_POST['role'];
    8181
    8282                // If the new role isn't editable by the logged-in user die with error
    … …  
    259259
    260260/**
    261  * Fetch a filtered list of user roles that the current user is 
    262  * allowed to edit. 
    263  *
    264  * Simple function who's main purpose is to allow filtering of the 
     261 * Fetch a filtered list of user roles that the current user is
     262 * allowed to edit.
     263 *
     264 * Simple function who's main purpose is to allow filtering of the
    265265 * list of roles in the $wp_roles object so that plugins can remove
    266266 * innappropriate ones depending on the situation or user making edits.
    … …  
    268268 * capability can edit others to be administrators, even if they are
    269269 * only editors or authors. This filter allows admins to delegate
    270  * user management. 
     270 * user management.
    271271 *
    272272 * @since 2.8
    … …  
    278278
    279279        $all_roles = $wp_roles->roles;
    280         $editable_roles = apply_filters('editable_roles', $all_roles); 
    281        
     280        $editable_roles = apply_filters('editable_roles', $all_roles);
     281
    282282        return $editable_roles;
    283283}
  • trunk/wp-admin/options-general.php

    r10770 r10810  
    9494</tr>
    9595<tr>
    96 <?php 
    97 if (!wp_timezone_supported()) : // no magic timezone support here 
     96<?php
     97if (!wp_timezone_supported()) : // no magic timezone support here
    9898?>
    9999<th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th>
    … …  
    131131<span class="setting-description"><?php _e('Unfortunately, you have to manually update this for Daylight Savings Time. Lame, we know, but will be fixed in the future.'); ?></span>
    132132</td>
    133 <?php 
     133<?php
    134134else: // looks like we can do nice timezone selection!
    135135$current_offset = get_option('gmt_offset');
    … …  
    159159        <br />
    160160        <?php
    161         if (function_exists('timezone_transitions_get') && $tzstring) { 
     161        if (function_exists('timezone_transitions_get') && $tzstring) {
    162162                $dateTimeZoneSelected = new DateTimeZone($tzstring);
    163163                foreach (timezone_transitions_get($dateTimeZoneSelected) as $tr) {
    … …  
    167167                        }
    168168                }
    169        
     169
    170170                if ($found) {
    171171                        _e(' ');
  • trunk/wp-admin/press-this.php

    r10375 r10810  
    489489                                <h3><span><?php _e('Post Tags'); ?></span></h3>
    490490                                <div class="inside">
    491                                         <div class="tagsdiv" id="post_tag"> 
     491                                        <div class="tagsdiv" id="post_tag">
    492492                                                <p class="jaxtag">
    493493                                                        <label class="hidden" for="newtag"><?php _e('Post Tags'); ?></label>
    494                                                         <input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" /> 
     494                                                        <input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" />
    495495                                                        <span class="ajaxtag" style="display:none;">
    496496                                                                <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php _e('Add new tag'); ?>" />
    497497                                                                <input type="button" class="button tagadd" value="Add" tabindex="3" />
    498498                                                        </span>
    499                                                 </p> 
    500                                                 <div class="tagchecklist"></div> 
     499                                                </p>
     500                                                <div class="tagchecklist"></div>
    501501                                        </div>
    502502                                        <p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags in Post Tags'); ?></a></p>
  • trunk/wp-admin/themes.php

    r10715 r10810  
    192192        $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . attribute_escape(sprintf(__('Preview "%s"'), $theme_name)) . '">' . __('Preview') . '</a>';
    193193        if ( current_user_can('update_themes') )
    194                 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template=$template", 'delete-theme_' . $template) . '" onclick="' . "if ( confirm('" . js_escape(sprintf( __("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';   
     194                $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template=$template", 'delete-theme_' . $template) . '" onclick="' . "if ( confirm('" . js_escape(sprintf( __("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';
    195195        $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
    196196
  • trunk/wp-includes/author-template.php

    r10661 r10810  
    518518
    519519        foreach ( (array) $authors as $author ) {
    520                
    521                 $link = ''; 
    522                
     520
     521                $link = '';
     522
    523523                $author = get_userdata( $author->ID );
    524524                $posts = (isset($author_count[$author->ID])) ? $author_count[$author->ID] : 0;
  • trunk/wp-includes/classes.php

    r10782 r10810  
    356356                }
    357357
    358                 $headers = apply_filters('wp_headers', $headers, $this); 
    359 
    360                 if ( ! empty( $status ) ) 
     358                $headers = apply_filters('wp_headers', $headers, $this);
     359
     360                if ( ! empty( $status ) )
    361361                        status_header( $status );
    362362                foreach( (array) $headers as $name => $field_value )
  • trunk/wp-includes/comment-template.php

    r10778 r10810  
    10301030        extract($args, EXTR_SKIP);
    10311031        $post = get_post($post);
    1032        
     1032
    10331033        if ( !comments_open($post->ID) )
    10341034                return false;
  • trunk/wp-includes/comment.php

    r10767 r10810  
    13411341        $pinged  = get_pung($post_id);
    13421342        if ( empty($to_ping) ) {
    1343                 $wpdb->update($wpdb->posts, array('to_ping' => ''), array('ID' => $post_id) ); 
     1343                $wpdb->update($wpdb->posts, array('to_ping' => ''), array('ID' => $post_id) );
    13441344                return;
    13451345        }
  • trunk/wp-includes/default-widgets.php

    r10809 r10810  
    11<?php
    22
    3 /** 
    4  * Default Widgets 
     3/**
     4 * Default Widgets
    55 *
    66 * @package WordPress
    … …  
    4343                }
    4444        }
    45        
     45
    4646        function update( $new_instance, $old_instance ) {
    4747                $instance = $old_instance;
    … …  
    5757                return $instance;
    5858        }
    59        
     59
    6060        function form( $instance ) {
    6161                //Defaults
    … …  
    103103                $show_rating = isset($instance['rating']) ? $instance['rating'] : false;
    104104                $show_images = isset($instance['images']) ? $instance['images'] : true;
    105        
     105
    106106                $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget);
    107107                wp_list_bookmarks(apply_filters('widget_links_args', array(
    … …  
    113113                )));
    114114        }
    115        
     115
    116116        function update( $new_instance, $old_instance ) {
    117117                $new_instance = (array) $new_instance;
    … …  
    121121                                $instance[$field] = 1;
    122122                }
    123        
     123
    124124                return $instance;
    125125        }
    126        
     126
    127127        function form( $instance ) {
    128128
    … …  
    163163                get_search_form();
    164164
    165                 echo $after_widget;     
     165                echo $after_widget;
    166166        }
    167167}
    … …  
    233233 *
    234234 * Displays log in/out, RSS feed links, etc.
    235  * 
     235 *
    236236 * @since 2.8.0
    237237 */
    … …  
    415415                }
    416416
    417                 echo $after_widget;             
    418         }
    419        
     417                echo $after_widget;
     418        }
     419
    420420        function update( $new_instance, $old_instance ) {
    421421                $instance = $old_instance;
    … …  
    427427                return $instance;
    428428        }
    429        
     429
    430430        function form( $instance ) {
    431431                //Defaults
  • trunk/wp-includes/functions.php

    r10795 r10810  
    652652 * If the transient does not exist or does not have a value, then the return value
    653653 * will be false.
    654  * 
     654 *
    655655 * @since 2.8.0
    656656 * @package WordPress
    … …  
    711711                        $autoload = 'yes';
    712712                        if ( 0 != $expiration ) {
    713                                 $autoload = 'no'; 
     713                                $autoload = 'no';
    714714                                add_option($transient_timeout, time() + $expiration, '', 'no');
    715715                        }
    … …  
    14901490                'Pragma' => 'no-cache',
    14911491        );
    1492        
     1492
    14931493        if ( function_exists('apply_filters') ) {
    14941494                $headers = apply_filters('nocache_headers', $headers);
    … …  
    15081508function nocache_headers() {
    15091509        $headers = wp_get_nocache_headers();
    1510         foreach( (array) $headers as $name => $field_value ) 
    1511                 @header("{$name}: {$field_value}");             
     1510        foreach( (array) $headers as $name => $field_value )
     1511                @header("{$name}: {$field_value}");
    15121512}
    15131513
    … …  
    30523052/**
    30533053 * gmt_offset modification for smart timezone handling
    3054  * 
     3054 *
    30553055 * Overrides the gmt_offset option if we have a timezone_string available
    30563056 */
    … …  
    30623062
    30633063        @date_default_timezone_set($tz);
    3064                
     3064
    30653065        $dateTimeZoneSelected = timezone_open($tz);
    30663066        $dateTimeServer = date_create();
    30673067        if ($dateTimeZoneSelected === false || $dateTimeServer === false) return false;
    3068                
     3068
    30693069        $timeOffset = timezone_offset_get($dateTimeZoneSelected, $dateTimeServer);
    30703070        $timeOffset = $timeOffset / 3600;
    3071                
     3071
    30723072        return $timeOffset;
    30733073}
    … …  
    30753075/**
    30763076 * Check for PHP timezone support
    3077  * 
     3077 *
    30783078 */
    30793079function wp_timezone_supported() {
    3080         if (function_exists('date_default_timezone_set') 
     3080        if (function_exists('date_default_timezone_set')
    30813081                && function_exists('timezone_identifiers_list')
    3082                 && function_exists('timezone_open') 
     3082                && function_exists('timezone_open')
    30833083                && function_exists('timezone_offset_get')
    3084                 ) 
     3084                )
    30853085                return true;
    30863086
    … …  
    31093109                $i++;
    31103110        }
    3111        
     3111
    31123112        asort($zonen);
    31133113        $structure = '';
  • trunk/wp-includes/general-template.php

    r10774 r10810  
    458458                $title = "$tax$t_sep$term";
    459459        }
    460        
     460
    461461        //If it's a search
    462462        if ( is_search() ) {
  • trunk/wp-includes/http.php

    r10692 r10810  
    303303                foreach( (array) $transports as $transport ) {
    304304                        $response = $transport->request($url, $r);
    305                        
     305
    306306                        if( has_action('http_api_debug') )
    307307                                do_action( 'http_api_debug', $response, 'response', get_class($transport) );
    … …  
    539539
    540540                $home = parse_url( get_bloginfo('site_url') );
    541                
     541
    542542                // Don't block requests back to ourselves by default
    543543                if ( $uri == 'localhost' || $uri == $home['host'] )
    … …  
    938938                $proxy = new WP_HTTP_Proxy();
    939939
    940                 if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { 
     940                if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
    941941                        $arrContext['http']['proxy'] = 'tcp://'.$proxy->host().':'.$proxy->port();
    942942
    … …  
    10781078                        'useragent' => $r['user-agent'],
    10791079                        'headers' => $r['headers'],
    1080                         'ssl' => array( 
     1080                        'ssl' => array(
    10811081                                'verifypeer' => apply_filters('https_ssl_verify', $r['sslverify']),
    10821082                                'verifyhost' => apply_filters('https_ssl_verify', $r['sslverify'])
    … …  
    12771277                if ( !empty($theResponse) ) {
    12781278                        $parts = explode("\r\n\r\n", $theResponse);
    1279                        
     1279
    12801280                        $headerLength = curl_getinfo($handle, CURLINFO_HEADER_SIZE);
    12811281                        $theHeaders = trim( substr($theResponse, 0, $headerLength) );
    … …  
    13591359
    13601360        function __construct() {
    1361                
     1361
    13621362        }
    13631363
    … …  
    16311631        /**
    16321632         * Confirms that it's OK to send this cookie to the URL checked against.
    1633          * 
     1633         *
    16341634         * Decision is based on RFC 2109/2965, so look there for details on validity.
    16351635         *
    … …  
    16841684                if ( empty( $this->name ) || empty( $this->value ) )
    16851685                        return '';
    1686                
     1686
    16871687                return $this->name . '=' . urlencode( $this->value );
    16881688        }
  • trunk/wp-includes/l10n.php

    r10774 r10810  
    231231/**
    232232 * Register plural strings with context in POT file, but don't translate them.
    233  * 
     233 *
    234234 * @see _n_noop()
    235235 */
    … …  
    261261
    262262        if ( !is_readable($mofile)) return;
    263        
     263
    264264        $mo = new MO();
    265265        $mo->import_from_file( $mofile );
    … …  
    267267        if (isset($l10n[$domain]))
    268268                $mo->merge_with( $l10n[$domain] );
    269                
     269
    270270        $l10n[$domain] = &$mo;
    271271}
    … …  
    339339 * Returns the Translations instance for a domain. If there isn't one,
    340340 * returns empty Translations instance.
    341  * 
     341 *
    342342 * @param string $domain
    343343 * @return object A Translation instance
    … …  
    353353 * not in the source there are dummy gettext calls to get them into the POT
    354354 * file and this function properly translates them back.
    355  * 
     355 *
    356356 * The before_last_bar() call is needed, because older installs keep the roles
    357357 * using the old context format: 'Role name|User role' and just skipping the
  • trunk/wp-includes/link-template.php

    r10578 r10810  
    15291529                        $url .= '/' . ltrim($folder, '/');
    15301530        }
    1531        
     1531
    15321532        if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
    15331533                $url .= '/' . ltrim($path, '/');
  • trunk/wp-includes/pluggable.php

    r10730 r10810  
    331331        /* If we don't have an email from the input headers default to wordpress@$sitename
    332332         * Some hosts will block outgoing mail from this address if it doesn't exist but
    333          * there's no easy alternative. Defaulting to admin_email might appear to be another 
     333         * there's no easy alternative. Defaulting to admin_email might appear to be another
    334334         * option but some hosts may refuse to relay mail from an unknown domain. See
    335335         * http://trac.wordpress.org/ticket/5007.
    336336         */
    337        
     337
    338338        if ( !isset( $from_email ) ) {
    339339                // Get the site domain and get rid of www.
    … …  
    13841384 *
    13851385 * @param int $length The length of password to generate
    1386  * @param bool $special_chars Whether to include standard special characters 
     1386 * @param bool $special_chars Whether to include standard special characters
    13871387 * @return string The random password
    13881388 **/
    … …  
    15191519
    15201520        if ( is_ssl() )
    1521                 $host = 'https://secure.gravatar.com'; 
     1521                $host = 'https://secure.gravatar.com';
    15221522        else
    15231523                $host = 'http://www.gravatar.com';
  • trunk/wp-includes/pomo/mo.php

    r10584 r10810  
    4343                // 0xde120495
    4444                $magic_big = ((int) - 569244523) && 0xFFFFFFFF;
    45                
     45
    4646                if ($magic_little == $magic || $magic_little_64 == $magic) {
    4747                        return 'little';
    … …  
    6868
    6969                $reader->seekto($originals_lo_addr);
    70                 $originals_lo = $reader->readint32array($total * 2); // each of 
     70                $originals_lo = $reader->readint32array($total * 2); // each of
    7171                $reader->seekto($translations_lo_addr);
    72                 $translations_lo = $reader->readint32array($total * 2); 
     72                $translations_lo = $reader->readint32array($total * 2);
    7373
    7474                $length = create_function('$i', 'return $i * 2 + 1;');
  • trunk/wp-includes/pomo/po.php

    r10584 r10810  
    1818 */
    1919class PO extends Translations {
    20        
     20
    2121
    2222        /**
    … …  
    9595                        "$quote"        => "$slash$quote",
    9696                );
    97                 $string = str_replace(array_keys($replaces), array_values($replaces), $string); 
     97                $string = str_replace(array_keys($replaces), array_values($replaces), $string);
    9898
    9999                $po = array();
    … …  
    112112
    113113        /**
    114          * Inserts $with in the beginning of every new line of $string and 
     114         * Inserts $with in the beginning of every new line of $string and
    115115         * returns the modified string
    116116         *
    … …  
    154154        function export_entry(&$entry) {
    155155                if (is_null($entry->singular)) return false;
    156                 $po = array(); 
     156                $po = array();
    157157                if (!empty($entry->translator_comments)) $po[] = PO::comment_block($entry->translator_comments);
    158158                if (!empty($entry->extracted_comments)) $po[] = PO::comment_block($entry->extracted_comments, '.');
  • trunk/wp-includes/pomo/translations.php

    r10584 r10810  
    131131         * Adds parantheses to the inner parts of ternary operators in
    132132         * plural expressions, because PHP evaluates ternary oerators from left to right
    133          * 
     133         *
    134134         * @param string $expression the expression without parentheses
    135135         * @return string the expression with parentheses added
    … …  
    159159                return rtrim($res, ';');
    160160        }
    161        
     161
    162162        /**
    163163         * Merge $other in the current object.
  • trunk/wp-includes/post-template.php

    r10774 r10810  
    361361function get_body_class( $class = '' ) {
    362362        global $wp_query, $current_user;
    363        
     363
    364364        $classes = array();
    365        
     365
    366366        if ( 'rtl' == get_bloginfo('text_direction') )
    367367                $classes[] = 'rtl';
    368        
     368
    369369        if ( is_front_page() )
    370370                $classes[] = 'home';
    … …  
    383383        if ( is_404() )
    384384                $classes[] = 'error404';
    385        
     385
    386386        if ( is_single() ) {
    387387                the_post();
    388                
     388
    389389                $postID = $wp_query->post->ID;
    390390                $classes[] = 'single postid-' . $postID;
    391                
     391
    392392                if ( is_attachment() ) {
    393393                        $mime_type = get_post_mime_type();
    … …  
    395395                        $classes[] = 'attachmentid-' . $postID . ' attachment-' . str_replace( $mime_prefix, "", "$mime_type" );
    396396                }
    397                
     397
    398398                rewind_posts();
    399399        } elseif ( is_archive() ) {
    … …  
    413413        } elseif ( is_page() ) {
    414414                the_post();
    415                
     415
    416416                $pageID = $wp_query->post->ID;
    417417                $page_children = wp_list_pages("child_of=$pageID&echo=0");
    418                
     418
    419419                if ( $page_children )
    420420                        $classes[] = 'page-parent';
    421                
     421
    422422                if ( $wp_query->post->post_parent )
    423423                        $classes[] = 'page-child parent-pageid-' . $wp_query->post->post_parent;
    424                
     424
    425425                if ( is_page_template() )
    426426                        $classes[] = 'page-template page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) );
    427                
     427
    428428                rewind_posts();
    429429        } elseif ( is_search() ) {
    430430                the_post();
    431                
     431
    432432                if ( have_posts() )
    433433                        $classes[] = 'search-results';
    434434                else
    435435                        $classes[] = 'search-no-results';
    436                
     436
    437437                rewind_posts();
    438438        }
    439        
     439
    440440        if ( is_user_logged_in() )
    441441                $classes[] = 'logged-in';
    442        
     442
    443443        $page = $wp_query->get('page');
    444        
     444
    445445        if ( !$page || $page < 2)
    446446                $page = $wp_query->get('paged');
    447        
     447
    448448        if ( $page && $page > 1 ) {
    449449                $classes[] = 'paged-' . $page;
    450                
     450
    451451                if ( is_single() )
    452452                        $classes[] = 'single-paged-' . $page;
    … …  
    464464                        $classes[] = 'search-paged-' . $page;
    465465        }
    466        
     466
    467467        if ( !empty($class) ) {
    468468                if ( !is_array( $class ) )
    … …  
    470470                $classes = array_merge($classes, $class);
    471471        }
    472        
     472
    473473        return apply_filters('body_class', $classes, $class);
    474474}
    … …  
    855855 */
    856856function walk_page_tree($pages, $depth, $current_page, $r) {
    857         if ( empty($r['walker']) ) 
     857        if ( empty($r['walker']) )
    858858                $walker = new Walker_Page;
    859859        else
    … …  
    926926
    927927        $post_title = attribute_escape($_post->post_title);
    928        
     928
    929929        if ( $text ) {
    930930                $link_text = attribute_escape($text);
    … …  
    935935        if( trim($link_text) == '' )
    936936                $link_text = $_post->post_title;
    937        
     937
    938938        return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
    939939}
  • trunk/wp-includes/post.php

    r10730 r10810  
    513513        if ( !$meta_key )
    514514                return false;
    515        
     515
    516516        global $wpdb;
    517517
    … …  
    564564        if ( !$meta_key )
    565565                return false;
    566        
     566
    567567        if ( empty( $meta_value ) )
    568568                $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) );
    … …  
    598598        if ( !$key )
    599599                return '';
    600        
     600
    601601        $post_id = (int) $post_id;
    602602
    … …  
    649649        if ( !$meta_key )
    650650                return false;
    651        
     651
    652652        if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) {
    653653                return add_post_meta($post_id, $meta_key, $meta_value);
    … …  
    681681        if ( !$post_meta_key )
    682682                return false;
    683        
     683
    684684        global $wpdb;
    685685        if ( $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)) ) {
    … …  
    757757        if ( !$key )
    758758                return null;
    759        
     759
    760760        $custom = get_post_custom($post_id);
    761761
    … …  
    15471547        if ( !empty($tax_input) ) {
    15481548                foreach ( $tax_input as $taxonomy => $tags ) {
    1549                         wp_set_post_terms( $post_ID, $tags, $taxonomy );                       
     1549                        wp_set_post_terms( $post_ID, $tags, $taxonomy );
    15501550                }
    15511551        }
    … …  
    35273527        $post = _wp_post_revision_fields( $post, $autosave );
    35283528        $post = add_magic_quotes($post); //since data is from db
    3529        
     3529
    35303530        $revision_id = wp_insert_post( $post );
    35313531        if ( is_wp_error($revision_id) )
    … …  
    36033603
    36043604        $update['ID'] = $revision['post_parent'];
    3605        
     3605
    36063606        $update = add_magic_quotes( $update ); //since data is from db
    36073607
  • trunk/wp-includes/script-loader.php

    r10793 r10810  
    77 * plugins will only be concerned about the filters and actions set in this
    88 * file.
    9  * 
     9 *
    1010 * Several constants are used to manage the loading, concatenating and compression of scripts and CSS:
    1111 * define('SCRIPT_DEBUG', true); loads the develppment (non-minified) versions of all scripts
    … …  
    1414 * define('COMPRESS_CSS', false); disables compression of CSS,
    1515 * define('ENFORCE_GZIP', true); forces gzip for compression (default is deflate).
    16  * 
     16 *
    1717 * The globals $concatenate_scripts, $compress_scripts and $compress_css can be set by plugins
    1818 * to temporarily override the above settings. Also a compression test is run once and the result is saved
    1919 * as option 'can_compress_scripts' (0/1). The test will run again if that option is deleted.
    20  * 
     20 *
    2121 * @package WordPress
    2222 */
    … …  
    390390                $scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery-ui-draggable', 'jquery-ui-resizable' ), '20090113' );
    391391                $scripts->add_data( 'media', 'group', 1 );
    392                
     392
    393393                $scripts->add( 'codepress', '/wp-includes/js/codepress/codepress.js', false, '0.9.6' );
    394394                $scripts->add_data( 'codepress', 'group', 1 );
  • trunk/wp-includes/shortcodes.php

    r10658 r10810  
    157157 * The regular expression combines the shortcode tags in the regular expression
    158158 * in a regex class.
    159  * 
     159 *
    160160 * The regular expresion contains 6 different sub matches to help with parsing.
    161  * 
     161 *
    162162 * 1/6 - An extra [ or ] to allow for escaping shortcodes with double [[]]
    163163 * 2 - The shortcode name
    … …  
    165165 * 4 - The self closing /
    166166 * 5 - The content of a shortcode when it wraps some content.
    167  * 
     167 *
    168168 * @since 2.5
    169169 * @uses $shortcode_tags
    … …  
    197197                return substr($m[0], 1, -1);
    198198        }
    199        
     199
    200200        $tag = $m[2];
    201201        $attr = shortcode_parse_atts($m[3]);
  • trunk/wp-includes/taxonomy.php

    r10803 r10810  
    536536 *
    537537 * exclude_tree - A comma- or space-delimited string of term ids to exclude
    538  * from the return array, along with all of their descendant terms according to 
     538 * from the return array, along with all of their descendant terms according to
    539539 * the primary taxonomy.  If 'include' is non-empty, 'exclude_tree' is ignored.
    540540 *
    … …  
    693693                $excluded_trunks = preg_split('/[\s,]+/',$exclude_tree);
    694694                foreach( (array) $excluded_trunks as $extrunk ) {
    695                         $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids'));       
     695                        $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids'));
    696696                        $excluded_children[] = $extrunk;
    697697                        foreach( (array) $excluded_children as $exterm ) {
    … …  
    737737                $where .= ' AND tt.count > 0';
    738738
    739         // don't limit the query results when we have to descend the family tree 
     739        // don't limit the query results when we have to descend the family tree
    740740        if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' == $parent ) {
    741741                if( $offset )
  • trunk/wp-includes/widgets.php

    r10808 r10810  
    4646/**
    4747 * Singleton that registers and instantiates WP_Widget classes.
    48  * 
     48 *
    4949 * @package WordPress
    5050 * @subpackage Widgets
    … …  
    7171 * This class must be extended for each widget and WP_Widget::widget(), WP_Widget::update()
    7272 * and WP_Widget::form() need to be over-ridden.
    73  * 
     73 *
    7474 * @package WordPress
    7575 * @subpackage Widgets
    … …  
    289289                _register_widget_form_callback( $this->id, $this->name, $this->_get_form_callback(), $this->control_options, array( 'number' => $number ) );
    290290        }
    291        
     291
    292292        function save_settings($settings) {
    293293                $settings['_multiwidget'] = 1;
    … …  
    296296
    297297        function get_settings() {
    298                 $settings = get_option($this->option_name);     
     298                $settings = get_option($this->option_name);
    299299
    300300                if ( !is_array($settings) )
    … …  
    315315/**
    316316 * Register a widget
    317  * 
     317 *
    318318 * Registers a WP_Widget widget
    319  * 
     319 *
    320320 * @since 2.8.0
    321  * 
     321 *
    322322 * @see WP_Widget
    323323 * @see WP_Widget_Factory
    324324 * @uses WP_Widget_Factory
    325  * 
     325 *
    326326 * @param string $widget_class The name of a class that extends WP_Widget
    327327 */
    … …  
    923923        if ( $single ) {
    924924                $settings = array( 2 => $settings );
    925                
     925
    926926                $sidebars_widgets = get_option('sidebars_widgets');
    927927                foreach ( (array) $sidebars_widgets as $index => $sidebar ) {
    … …  
    941941        $settings['_multiwidget'] = 1;
    942942        update_option( $option_name, $settings );
    943        
     943
    944944        return $settings;
    945945}
    … …  
    948948 * Deprecated API
    949949 */
    950  
     950
    951951/**
    952952 * Register widget for sidebar with backwards compatibility.
  • trunk/wp-includes/wp-db.php

    r10735 r10810  
    436436                        return mysql_real_escape_string( $string, $this->dbh );
    437437                else
    438                         return addslashes( $string );   
     438                        return addslashes( $string );
    439439        }
    440440
  • trunk/wp-mail.php

    r10412 r10810  
    143143        }
    144144
    145         $subject = trim($subject);     
    146        
     145        $subject = trim($subject);
     146
    147147        if ( $content_type == 'multipart/alternative' ) {
    148148                $content = explode('--'.$boundary, $content);
    … …  
    160160        //Either the raw content or the content of the last quoted-printable section
    161161        $content = apply_filters('wp_mail_original_content', $content);
    162        
     162
    163163        if ( false !== stripos($content_transfer_encoding, "quoted-printable") ) {
    164164                $content = quoted_printable_decode($content);
  • trunk/wp-settings.php

    r10808 r10810  
    203203} else {
    204204        // Unicode Extension is in PHP 6.0 only or do version check when this changes.
    205         if ( function_exists('unicode_decode') ) 
     205        if ( function_exists('unicode_decode') )
    206206                error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ^ E_STRICT );
    207207        else if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3
    … …  
    378378 * @since 2.8.0
    379379 */
    380 if ( !defined( 'MUPLUGINDIR' ) ) 
     380if ( !defined( 'MUPLUGINDIR' ) )
    381381        define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH.  For back compat.
    382382
  • trunk/xmlrpc.php

    r10730 r10810  
    22162216                }
    22172217
    2218                 // Only posts can be sticky 
    2219                 if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) 
    2220                         if ( $content_struct['sticky'] == true ) 
    2221                                 stick_post( $post_ID ); 
    2222                         elseif ( $content_struct['sticky'] == false ) 
    2223                                 unstick_post( $post_ID ); 
     2218                // Only posts can be sticky
     2219                if ( $post_type == 'post' && isset( $content_struct['sticky'] ) )
     2220                        if ( $content_struct['sticky'] == true )
     2221                                stick_post( $post_ID );
     2222                        elseif ( $content_struct['sticky'] == false )
     2223                                unstick_post( $post_ID );
    22242224
    22252225                if ( isset($content_struct['custom_fields']) ) {
    … …  
    22392239        function add_enclosure_if_new($post_ID, $enclosure) {
    22402240                if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
    2241                
     2241
    22422242                        $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'];
    22432243                        $found = false;
    … …  
    22572257                }
    22582258        }
    2259        
     2259
    22602260        /**
    22612261         * Attach upload to a post.
    … …  
    25232523                }
    25242524
    2525                 // Only posts can be sticky 
    2526                 if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) 
    2527                         if ( $content_struct['sticky'] == true ) 
    2528                                 stick_post( $post_ID ); 
    2529                         elseif ( $content_struct['sticky'] == false ) 
    2530                                 unstick_post( $post_ID ); 
     2525                // Only posts can be sticky
     2526                if ( $post_type == 'post' && isset( $content_struct['sticky'] ) )
     2527                        if ( $content_struct['sticky'] == true )
     2528                                stick_post( $post_ID );
     2529                        elseif ( $content_struct['sticky'] == false )
     2530                                unstick_post( $post_ID );
    25312531
    25322532                if ( isset($content_struct['custom_fields']) ) {
    … …  
    26042604                        }
    26052605
    2606                         $sticky = false; 
    2607                         if ( is_sticky( $post_ID ) ) 
    2608                                 $sticky = true; 
     2606                        $sticky = false;
     2607                        if ( is_sticky( $post_ID ) )
     2608                                $sticky = true;
    26092609
    26102610                        $enclosure = array();
Note: See TracChangeset for help on using the changeset viewer.