Make WordPress Core

Changes from tags/2.7.1 at r10539 to tags/2.7 at r10539


Ignore:
Location:
tags/2.7
Files:
65 edited

Legend:

Unmodified
Added
Removed
  • tags/2.7/wp-admin/admin-ajax.php

    r10539 r10539  
    431431        if ( empty( $tags ) )
    432432                die( __('No tags found!') );
    433 
    434         if ( is_wp_error($tags) )
    435                 die($tags->get_error_message());
    436433
    437434        foreach ( $tags as $key => $tag ) {
     
    724721
    725722        $data = '';
    726         $message = sprintf( __('Draft Saved at %s.'), date_i18n( __('g:i:s a') ) );
     723        $message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) );
    727724
    728725        $supplemental = array();
  • tags/2.7/wp-admin/admin.php

    r10539 r10539  
    6262                // backwards compatibility for plugins using add_management_page
    6363                if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
    64                         // There could be plugin specific params on the URL, so we need the whole query string
    65                         if ( !empty($_SERVER[ 'QUERY_STRING' ]) )
    66                                 $query_string = $_SERVER[ 'QUERY_STRING' ];
    67                         else
    68                                 $query_string = 'page=' . $plugin_page;
    69                         wp_redirect( 'tools.php?' . $query_string );
     64                        wp_redirect('tools.php?page=' . $plugin_page);
    7065                        exit;
    7166                }
  • tags/2.7/wp-admin/css/colors-classic.css

    r10539 r10539  
    614614}
    615615
    616 .plugins .active,
    617 .plugins .active th,
    618 .plugins .active td {
     616.plugins .active {
    619617        background-color: #e7f7d3;
    620618}
    621619
    622 #the-comment-list .unapproved,
    623 #the-comment-list .unapproved th,
    624 #the-comment-list .unapproved td {
     620.plugins .togl {
     621        border-right-color: #ccc;
     622}
     623
     624#the-comment-list .unapproved {
    625625        background-color: #ffffe0;
    626626}
  • tags/2.7/wp-admin/css/colors-fresh.css

    r10539 r10539  
    614614}
    615615
    616 .plugins .active,
    617 .plugins .active th,
    618 .plugins .active td {
     616.plugins .active {
    619617        background-color: #e7f7d3;
    620618}
    621619
    622 #the-comment-list .unapproved,
    623 #the-comment-list .unapproved th,
    624 #the-comment-list .unapproved td {
     620.plugins .togl {
     621        border-right-color: #ccc;
     622}
     623
     624#the-comment-list .unapproved {
    625625        background-color: #ffffe0;
    626626}
  • tags/2.7/wp-admin/css/ie.css

    r10539 r10539  
    179179}
    180180/* end Inline Editor */
    181 
    182 input {
    183         line-height: 1;
    184 }
    185181
    186182* html .row-actions {
     
    278274}
    279275
    280 #ed_toolbar input,
    281 #ed_reply_toolbar input {
     276#ed_toolbar input {
    282277        overflow: visible;
    283278        padding: 0 4px;
  • tags/2.7/wp-admin/css/press-this.css

    r10539 r10539  
    121121        padding: 7px;
    122122        margin: 0 0 10px;
    123         background: #dfdfdf url("../images/gray-grad.png") repeat-x left top;
     123        background-image: url(../images/postbox-bg.gif);
     124        background-position: left top;
     125        background-repeat: repeat-x;
    124126        font-size: 12px;
    125127        font-weight: bold;
  • tags/2.7/wp-admin/edit-comments.php

    r10539 r10539  
    1919
    2020        $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
    21         if ( current_user_can('moderate_comments')) {
    22                 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" );
    23         } else {
    24                 $deleted_spam = 0;
    25         }
     21        $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" );
     22
    2623        $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam;
    2724        if ( $post_id )
     
    276273
    277274if ( 'spam' == $comment_status ) {
    278         wp_nonce_field('bulk-spam-delete', '_spam_nonce');
    279         if ( current_user_can ('moderate_comments')) { ?>
    280                 <input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
    281 <?php   }
    282 } ?>
     275        wp_nonce_field('bulk-spam-delete', '_spam_nonce'); ?>
     276<input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
     277<?php } ?>
    283278<?php do_action('manage_comments_nav', $comment_status); ?>
    284279</div>
     
    330325<option value="unapprove"><?php _e('Unapprove'); ?></option>
    331326<?php endif; ?>
    332 <?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
     327<?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?>
    333328<option value="approve"><?php _e('Approve'); ?></option>
    334329<?php endif; ?>
  • tags/2.7/wp-admin/edit-link-form.php

    r10539 r10539  
    119119                <label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
    120120                <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
    121                 <input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
     121                <input type="button" id="category-add-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
    122122                <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
    123123                <span id="category-ajax-response"></span>
  • tags/2.7/wp-admin/import/blogger.php

    r10539 r10539  
    551551
    552552                // Clean up content
    553                 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     553                $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
    554554                $post_content = str_replace('<br>', '<br />', $post_content);
    555555                $post_content = str_replace('<hr>', '<hr />', $post_content);
     
    604604
    605605                // Clean up content
    606                 $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
     606                $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
    607607                $comment_content = str_replace('<br>', '<br />', $comment_content);
    608608                $comment_content = str_replace('<hr>', '<hr />', $comment_content);
  • tags/2.7/wp-admin/import/blogware.php

    r10539 r10539  
    9090
    9191                        // Clean up content
    92                         $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     92                        $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
    9393                        $post_content = str_replace('<br>', '<br />', $post_content);
    9494                        $post_content = str_replace('<hr>', '<hr />', $post_content);
     
    130130
    131131                                        // Clean up content
    132                                         $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
     132                                        $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
    133133                                        $comment_content = str_replace('<br>', '<br />', $comment_content);
    134134                                        $comment_content = str_replace('<hr>', '<hr />', $comment_content);
  • tags/2.7/wp-admin/import/livejournal.php

    r10539 r10539  
    7171
    7272                        // Clean up content
    73                         $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     73                        $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
    7474                        $post_content = str_replace('<br>', '<br />', $post_content);
    7575                        $post_content = str_replace('<hr>', '<hr />', $post_content);
     
    107107
    108108                                        // Clean up content
    109                                         $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
     109                                        $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
    110110                                        $comment_content = str_replace('<br>', '<br />', $comment_content);
    111111                                        $comment_content = str_replace('<hr>', '<hr />', $comment_content);
  • tags/2.7/wp-admin/import/mt.php

    r10539 r10539  
    439439                        } else {
    440440                                // Processing multi-line field, check context.
    441                                
    442                                 if( !empty($line) )
    443                                         $line .= "\n";
    444                                        
     441
     442                                $line .= "\n";
    445443                                if ( 'body' == $context ) {
    446444                                        $post->post_content .= $line;
  • tags/2.7/wp-admin/import/rss.php

    r10539 r10539  
    104104
    105105                        // Clean up content
    106                         $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     106                        $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
    107107                        $post_content = str_replace('<br>', '<br />', $post_content);
    108108                        $post_content = str_replace('<hr>', '<hr />', $post_content);
  • tags/2.7/wp-admin/import/wordpress.php

    r10539 r10539  
    382382
    383383                $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
    384                 $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);
     384                $post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
    385385                $post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
    386386                $post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
    387387
    388388                $post_content = $this->get_tag( $post, 'content:encoded' );
    389                 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     389                $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
    390390                $post_content = str_replace('<br>', '<br />', $post_content);
    391391                $post_content = str_replace('<hr>', '<hr />', $post_content);
  • tags/2.7/wp-admin/includes/bookmark.php

    r10539 r10539  
    143143                $update = true;
    144144
    145         if ( trim( $link_name ) == '' ) {
    146                 if ( trim( $link_url ) != '' ) {
    147                         $link_name = $link_url;
    148                 } else {
    149                         return 0;
    150                 }
    151         }
     145        if ( trim( $link_name ) == '' )
     146                return 0;
    152147
    153148        if ( trim( $link_url ) == '' )
  • tags/2.7/wp-admin/includes/dashboard.php

    r10539 r10539  
    182182        // Posts
    183183        $num = number_format_i18n( $num_posts->publish );
    184         $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) );
    185         if ( current_user_can( 'edit_posts' ) ) {
    186                 $num = "<a href='edit.php'>$num</a>";
    187                 $text = "<a href='edit.php'>$text</a>";
    188         }
    189         echo '<td class="first b b-posts">' . $num . '</td>';
    190         echo '<td class="t posts">' . $text . '</td>';
     184        if ( current_user_can( 'edit_posts' ) )
     185                $text = "<a href='edit.php'>$num</a>";
     186        else
     187                $text = $num;
     188        echo '<td class="first b b-posts">' . $text . '</td>';
     189        echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . '</td>';
    191190        /* TODO: Show status breakdown on hover
    192191        if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can
     
    208207        // Total Comments
    209208        $num = number_format_i18n($num_comm->total_comments);
    210         $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments );
    211         if ( current_user_can( 'moderate_comments' ) ) {
     209        if ( current_user_can( 'moderate_comments' ) )
    212210                $num = "<a href='edit-comments.php'>$num</a>";
    213                 $text = "<a href='edit-comments.php'>$text</a>";
    214         }
    215         echo '<td class="b b-comments">' . $num . '</td>';
    216         echo '<td class="last t comments">' . $text . '</td>';
     211        echo '<td class="b b-comments">'.$num.'</td>';
     212        echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>';
    217213
    218214        echo '</tr><tr>';
     
    220216        // Pages
    221217        $num = number_format_i18n( $num_pages->publish );
    222         $text = __ngettext( 'Page', 'Pages', $num_pages->publish );
    223         if ( current_user_can( 'edit_pages' ) ) {
     218        if ( current_user_can( 'edit_pages' ) )
    224219                $num = "<a href='edit-pages.php'>$num</a>";
    225                 $text = "<a href='edit-pages.php'>$text</a>";
    226         }
    227         echo '<td class="first b b_pages">' . $num . '</td>';
    228         echo '<td class="t pages">' . $text . '</td>';
     220        echo '<td class="first b b_pages">'.$num.'</td>';
     221        echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>';
    229222
    230223        // Approved Comments
    231224        $num = number_format_i18n($num_comm->approved);
    232         $text = __ngettext( 'Approved', 'Approved', $num_comm->approved );
    233         if ( current_user_can( 'moderate_comments' ) ) {
     225        if ( current_user_can( 'moderate_comments' ) )
    234226                $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
    235                 $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>";
    236         }
    237         echo '<td class="b b_approved">' . $num . '</td>';
    238         echo '<td class="last t">' . $text . '</td>';
     227        echo '<td class="b b_approved">'.$num.'</td>';
     228        echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>';
    239229
    240230        echo "</tr>\n\t<tr>";
     
    242232        // Categories
    243233        $num = number_format_i18n( $num_cats );
    244         $text = __ngettext( 'Category', 'Categories', $num_cats );
    245         if ( current_user_can( 'manage_categories' ) ) {
     234        if ( current_user_can( 'manage_categories' ) )
    246235                $num = "<a href='categories.php'>$num</a>";
    247                 $text = "<a href='categories.php'>$text</a>";
    248         }
    249         echo '<td class="first b b-cats">' . $num . '</td>';
    250         echo '<td class="t cats">' . $text . '</td>';
     236        echo '<td class="first b b-cats">'.$num.'</td>';
     237        echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>';
    251238
    252239        // Pending Comments
    253240        $num = number_format_i18n($num_comm->moderated);
    254         $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated );
    255         if ( current_user_can( 'moderate_comments' ) ) {
     241        if ( current_user_can( 'moderate_comments' ) )
    256242                $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
    257                 $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
    258         }
    259         echo '<td class="b b-waiting">' . $num . '</td>';
    260         echo '<td class="last t">' . $text . '</td>';
     243        echo '<td class="b b-waiting">'.$num.'</td>';
     244        echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>';
    261245
    262246        echo "</tr>\n\t<tr>";
     
    264248        // Tags
    265249        $num = number_format_i18n( $num_tags );
    266         $text = __ngettext( 'Tag', 'Tags', $num_tags );
    267         if ( current_user_can( 'manage_categories' ) ) {
     250        if ( current_user_can( 'manage_categories' ) )
    268251                $num = "<a href='edit-tags.php'>$num</a>";
    269                 $text = "<a href='edit-tags.php'>$text</a>";
    270         }
    271         echo '<td class="first b b-tags">' . $num . '</td>';
    272         echo '<td class="t tags">' . $text . '</td>';
     252        echo '<td class="first b b-tags">'.$num.'</td>';
     253        echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>';
    273254
    274255        // Spam Comments
    275256        $num = number_format_i18n($num_comm->spam);
    276         $text = __ngettext( 'Spam', 'Spam', $num_comm->spam );
    277         if ( current_user_can( 'moderate_comments' ) ) {
     257        if ( current_user_can( 'moderate_comments' ) )
    278258                $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>";
    279                 $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>";
    280         }
    281         echo '<td class="b b-spam">' . $num . '</td>';
    282         echo '<td class="last t">' . $text . '</td>';
     259        echo '<td class="b b-spam">'.$num.'</td>';
     260        echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>';
    283261
    284262        echo "</tr>";
     
    304282        update_right_now_message();
    305283
    306         echo "\n\t".'<br class="clear" /></div>';
     284        echo "\n\t".'</div>';
    307285        do_action( 'rightnow_end' );
    308286        do_action( 'activity_box_end' );
  • tags/2.7/wp-admin/includes/file.php

    r10539 r10539  
    668668        $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : $credentials['private_key']);
    669669
    670         //sanitize the hostname, Some people might pass in odd-data:
    671         $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off
    672 
    673670        if ( strpos($credentials['hostname'], ':') )
    674671                list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2);
    675         else
    676                 unset($credentials['port']);
    677672
    678673        if ( defined('FTP_SSH') || (isset($_POST['connection_type']) && 'ssh' == $_POST['connection_type']) )
     
    685680        if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) {
    686681                $stored_credentials = $credentials;
    687                 if ( !empty($stored_credentials['port']) ) //save port as part of hostname to simplify above code.
    688                         $stored_credentials['hostname'] .= ':' . $stored_credentials['port'];
    689 
    690                 unset($stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key']);
     682                unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']);
    691683                update_option('ftp_credentials', $stored_credentials);
    692684                return $credentials;
  • tags/2.7/wp-admin/includes/media.php

    r10539 r10539  
    370370        check_admin_referer('media-form');
    371371
    372         if ( isset($_POST['send']) ) {
    373                 $keys = array_keys($_POST['send']);
    374                 $send_id = (int) array_shift($keys);
    375         }
    376        
    377372        if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
    378373                $post = $_post = get_post($attachment_id, ARRAY_A);
     
    385380                if ( isset($attachment['menu_order']) )
    386381                        $post['menu_order'] = $attachment['menu_order'];
    387                 if ( isset($send_id) && $attachment_id == $send_id ) {
    388                         if ( isset($attachment['post_parent']) )
    389                                 $post['post_parent'] = $attachment['post_parent'];
    390                 }
     382                if ( isset($attachment['post_parent']) )
     383                        $post['post_parent'] = $attachment['post_parent'];
    391384
    392385                $post = apply_filters('attachment_fields_to_save', $post, $attachment);
     
    416409        }
    417410
    418         if ( isset($send_id) ) {
     411        if ( isset($_POST['send']) ) {
     412                $keys = array_keys($_POST['send']);
     413                $send_id = (int) array_shift($keys);
    419414                $attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
    420415                $html = $attachment['post_title'];
  • tags/2.7/wp-admin/includes/plugin.php

    r10539 r10539  
    122122                        $plugin_data['Title'] = $plugin_data['Name'];
    123123
    124                 if ( ! empty($plugin_data['AuthorURI']) && ! empty($plugin_data['Author']) )
     124                if ( ! empty($plugin_data['AuthorURI']) )
    125125                        $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
    126126
     
    863863        $parent = get_admin_page_parent();
    864864
    865         if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
     865        if ( isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
    866866                return false;
    867867
  • tags/2.7/wp-admin/includes/post.php

    r10539 r10539  
    229229                $post_data = &$_POST;
    230230
    231         if ( isset($post_data['post_type']) && 'page' == $post_data['post_type'] ) {
     231        if ( 'page' == $post_data['post_type'] ) {
    232232                if ( ! current_user_can( 'edit_pages' ) )
    233233                        wp_die( __('You are not allowed to edit pages.') );
     
    237237        }
    238238
    239         $post_IDs = array_map( 'intval', (array) $post_data['post'] );
     239        $post_IDs = array_map( intval, (array) $post_data['post'] );
    240240
    241241        $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' );
     
    910910        }
    911911
    912         $post->filter = 'sample';
    913 
    914912        $permalink = get_permalink($post, true);
    915913
     
    929927        $post->post_date = $original_date;
    930928        $post->post_name = $original_name;
    931         unset($post->filter);
    932 
    933929        return $permalink;
    934930}
     
    11661162                        if ( ! empty($mce_external_languages) ) {
    11671163                                foreach ( $mce_external_languages as $name => $path ) {
    1168                                         if ( @is_file($path) && @is_readable($path) ) {
     1164                                        if ( is_file($path) && is_readable($path) ) {
    11691165                                                include_once($path);
    1170                                                 $ext_plugins .= $strings . "\n";
     1166                                                $ext_plugins .= $strings;
    11711167                                                $loaded_langs[] = $name;
    11721168                                        }
     
    11891185                                                $path = trailingslashit( realpath($path) );
    11901186
    1191                                         if ( @is_file($path . $mce_locale . '.js') )
    1192                                                 $strings .= @file_get_contents($path . $mce_locale . '.js') . "\n";
    1193 
    1194                                         if ( @is_file($path . $mce_locale . '_dlg.js') )
    1195                                                 $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') . "\n";
     1187                                        if ( is_file($path . $mce_locale . '.js') )
     1188                                                $strings .= @file_get_contents($path . $mce_locale . '.js');
     1189
     1190                                        if ( is_file($path . $mce_locale . '_dlg.js') )
     1191                                                $strings .= @file_get_contents($path . $mce_locale . '_dlg.js');
    11961192
    11971193                                        if ( 'en' != $mce_locale && empty($strings) ) {
    1198                                                 if ( @is_file($path . 'en.js') ) {
     1194                                                if ( is_file($path . 'en.js') ) {
    11991195                                                        $str1 = @file_get_contents($path . 'en.js');
    1200                                                         $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";
     1196                                                        $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 );
    12011197                                                }
    12021198
    1203                                                 if ( @is_file($path . 'en_dlg.js') ) {
     1199                                                if ( is_file($path . 'en_dlg.js') ) {
    12041200                                                        $str2 = @file_get_contents($path . 'en_dlg.js');
    1205                                                         $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n";
     1201                                                        $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 );
    12061202                                                }
    12071203                                        }
  • tags/2.7/wp-admin/includes/schema.php

    r10539 r10539  
    352352
    353353        // Add caps for Administrator role
    354         $role =& get_role('administrator');
     354        $role = get_role('administrator');
    355355        $role->add_cap('switch_themes');
    356356        $role->add_cap('edit_themes');
     
    385385
    386386        // Add caps for Editor role
    387         $role =& get_role('editor');
     387        $role = get_role('editor');
    388388        $role->add_cap('moderate_comments');
    389389        $role->add_cap('manage_categories');
     
    407407
    408408        // Add caps for Author role
    409         $role =& get_role('author');
     409        $role = get_role('author');
    410410        $role->add_cap('upload_files');
    411411        $role->add_cap('edit_posts');
     
    418418
    419419        // Add caps for Contributor role
    420         $role =& get_role('contributor');
     420        $role = get_role('contributor');
    421421        $role->add_cap('edit_posts');
    422422        $role->add_cap('read');
     
    425425
    426426        // Add caps for Subscriber role
    427         $role =& get_role('subscriber');
     427        $role = get_role('subscriber');
    428428        $role->add_cap('read');
    429429        $role->add_cap('level_0');
     
    438438        $roles = array('administrator', 'editor');
    439439        foreach ($roles as $role) {
    440                 $role =& get_role($role);
     440                $role = get_role($role);
    441441                if ( empty($role) )
    442442                        continue;
     
    459459        }
    460460
    461         $role =& get_role('administrator');
     461        $role = get_role('administrator');
    462462        if ( ! empty($role) ) {
    463463                $role->add_cap('delete_users');
     
    465465        }
    466466
    467         $role =& get_role('author');
     467        $role = get_role('author');
    468468        if ( ! empty($role) ) {
    469469                $role->add_cap('delete_posts');
     
    471471        }
    472472
    473         $role =& get_role('contributor');
     473        $role = get_role('contributor');
    474474        if ( ! empty($role) ) {
    475475                $role->add_cap('delete_posts');
     
    483483 */
    484484function populate_roles_230() {
    485         $role =& get_role( 'administrator' );
     485        $role = get_role( 'administrator' );
    486486
    487487        if ( !empty( $role ) ) {
     
    496496 */
    497497function populate_roles_250() {
    498         $role =& get_role( 'administrator' );
     498        $role = get_role( 'administrator' );
    499499
    500500        if ( !empty( $role ) ) {
     
    509509 */
    510510function populate_roles_260() {
    511         $role =& get_role( 'administrator' );
     511        $role = get_role( 'administrator' );
    512512
    513513        if ( !empty( $role ) ) {
     
    523523 */
    524524function populate_roles_270() {
    525         $role =& get_role( 'administrator' );
     525        $role = get_role( 'administrator' );
    526526
    527527        if ( !empty( $role ) ) {
  • tags/2.7/wp-admin/includes/template.php

    r10539 r10539  
    440440 * @param unknown_type $popular_cats
    441441 */
    442 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null ) {
    443         if ( empty($walker) || !is_a($walker, 'Walker') )
    444                 $walker = new Walker_Category_Checklist;
    445 
     442function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) {
     443        $walker = new Walker_Category_Checklist;
    446444        $descendants_and_self = (int) $descendants_and_self;
    447445
     
    24002398
    24012399        if ( $for_post )
    2402                 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true;
     2400                $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
    24032401
    24042402        $tab_index_attribute = '';
  • tags/2.7/wp-admin/index.php

    r10539 r10539  
    4242</div><!-- wrap -->
    4343
    44 <?php require(ABSPATH . 'wp-admin/admin-footer.php'); ?>
     44<?php require('./admin-footer.php'); ?>
  • tags/2.7/wp-admin/js/common.js

    r10539 r10539  
    11
    2 var wpCookies = {
     2wpCookies = {
    33// The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL.
    44
  • tags/2.7/wp-admin/js/editor.js

    r10539 r10539  
    11
    2 var switchEditors = {
     2switchEditors = {
    33
    44        mode : '',
     
    170170                return pee;
    171171        }
    172 };
     172}
  • tags/2.7/wp-admin/js/link.js

    r10539 r10539  
    1212        // Ajax Cat
    1313        var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } );
    14         jQuery('#category-add-submit').click( function() { newCat.focus(); } );
     14        jQuery('#category-add-sumbit').click( function() { newCat.focus(); } );
    1515        var noSyncChecks = false; // prophylactic. necessary?
    1616        var syncChecks = function() {
  • tags/2.7/wp-admin/js/plugin-install.js

    r10539 r10539  
    3030                return false;
    3131        });
     32
     33        $(window).resize( function() { tb_position() } );
    3234});
    3335
  • tags/2.7/wp-admin/link-manager.php

    r10539 r10539  
    169169                $link->link_category = wp_get_link_cats($link->link_id);
    170170                $short_url = str_replace('http://', '', $link->link_url);
    171                 $short_url = preg_replace('/^www./i', '', $short_url);
     171                $short_url = str_replace('www.', '', $short_url);
    172172                if ('/' == substr($short_url, -1))
    173173                        $short_url = substr($short_url, 0, -1);
  • tags/2.7/wp-admin/menu-header.php

    r10539 r10539  
    7575                        $submenu[$item[2]] = array_values($submenu[$item[2]]);  // Re-index.
    7676                        $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
    77                         if ( ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") && ('index.php' != $submenu[$item[2]][0][2]) ) || !empty($menu_hook)) {
     77                        if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) {
    7878                                $admin_is_parent = true;
    7979                                echo "$img$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>{$item[0]}</a>";
     
    116116                                $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
    117117
    118                                 if ( ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") && ('index.php' != $sub_item[2]) ) || ! empty($menu_hook) ) {
     118                                if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {
    119119                                        // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
    120120                                        $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]);
  • tags/2.7/wp-admin/menu.php

    r10539 r10539  
    8484}
    8585
    86 $menu[55] = array( __('Tools'), 'read', 'tools.php', '', 'menu-top', 'menu-tools', 'div' );
     86$menu[55] = array( __('Tools'), 'manage_options', 'tools.php', '', 'menu-top', 'menu-tools', 'div' );
    8787        $submenu['tools.php'][5] = array( __('Tools'), 'read', 'tools.php' );
    8888        $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' );
  • tags/2.7/wp-admin/theme-editor.php

    r10539 r10539  
    9797
    9898$description = get_file_description($file);
    99 $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (%s)" : "%s";
     99$desc_header = ( $description != $file_show ) ? "$description</strong> (%s)" : "%s";
    100100?>
    101101<div class="wrap">
     
    121121<div class="tablenav">
    122122<div class="alignleft">
    123 <big><?php echo sprintf($desc_header, $file_show); ?></big>
     123<big><strong><?php echo sprintf($desc_header, $file_show); ?></big>
    124124</div>
    125125<br class="clear" />
  • tags/2.7/wp-admin/update-core.php

    r10539 r10539  
    135135        global $wp_filesystem;
    136136
    137         if ( $reinstall )
    138                 $url = 'update-core.php?action=do-core-reinstall';
    139         else
    140                 $url = 'update-core.php?action=do-core-upgrade';
    141         $url = wp_nonce_url($url, 'upgrade-core');
     137        $url = wp_nonce_url('update-core.php?action=do-core-upgrade', 'upgrade-core');
    142138        if ( false === ($credentials = request_filesystem_credentials($url)) )
    143139                return;
  • tags/2.7/wp-admin/wp-admin.css

    r10539 r10539  
    1616}
    1717
    18 .plugins .action-links {
    19         white-space: nowrap;
     18.plugins .togl {
     19        width: 150px;
    2020}
    2121
     
    436436}
    437437
    438 #ed_toolbar input,
    439 #ed_reply_toolbar input {
     438#ed_toolbar input {
    440439        margin: 3px 1px 4px;
    441440        line-height: 18px;
     
    450449        -webkit-border-radius: 3px;
    451450        border-radius: 3px;
    452 }
    453 
    454 #ed_reply_toolbar input {
    455         margin: 1px 2px 1px 1px;
    456451}
    457452
     
    16491644
    16501645#edit-slug-box {
    1651         height: 1em;
    16521646        margin-top: 8px;
    16531647        padding: 0 7px;
     
    18591853        padding: 0;
    18601854        line-height: 19px;
    1861 }
    1862 
    1863 #category-adder h4 {
    1864         margin-top: 4px;
    1865         margin-bottom: 0px;
    1866 }
    1867 
    1868 #categorydiv .ui-tabs-panel {
    1869         border-width: 3px;
    1870         border-style: solid;
    1871 }
    1872 
    1873 ul#category-tabs {
    1874         margin-top: 12px;
    1875 }
    1876 
    1877 ul#category-tabs li {
    1878         padding: 5px 8px;
    1879         -moz-border-radius: 3px 3px 0 0;
    1880         -webkit-border-top-left-radius: 3px;
    1881         -webkit-border-top-right-radius: 3px;
    1882         -khtml-border-top-left-radius: 3px;
    1883         -khtml-border-top-right-radius: 3px;
    1884         border-top-left-radius: 3px;
    1885         border-top-right-radius: 3px;
    18861855}
    18871856
     
    22842253}
    22852254
     2255#replyrow #ed_reply_toolbar input {
     2256        margin: 1px 2px 1px 1px;
     2257        min-width: 24px;
     2258        padding: 3px 4px;
     2259        font-size: 11px;
     2260        -moz-border-radius: 3px;
     2261        -khtml-border-radius: 3px;
     2262        -webkit-border-radius: 3px;
     2263        border-radius: 3px;
     2264}
     2265
    22862266/* show/hide settings */
     2267
    22872268#screen-meta {
    22882269        position: relative;
  • tags/2.7/wp-config-sample.php

    r10539 r10539  
    3838 *
    3939 * Change these to different unique phrases!
    40  * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
     40 * You can generate these using the {@link http://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
    4141 *
    4242 * @since 2.6.0
  • tags/2.7/wp-includes/bookmark-template.php

    r10539 r10539  
    2727 * 'show_images' - Default is 1 (integer). Whether to show link image if
    2828 *              available.
    29  * 'show_name' - Default is 0 (integer). Whether to show link name if
     29 * 'show_name' - Default is 1 (integer). Whether to show link name if
    3030 *              available.
    3131 * 'before' - Default is '<li>' (string). The html or text to prepend to each
  • tags/2.7/wp-includes/canonical.php

    r10539 r10539  
    120120                        if ( $redirect_url = get_year_link(get_query_var('year')) )
    121121                                $redirect['query'] = remove_query_arg('year', $redirect['query']);
    122                 } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) {
     122                } elseif ( is_category() && !empty($_GET['cat']) ) {
    123123                        if ( $redirect_url = get_category_link(get_query_var('cat')) )
    124124                                $redirect['query'] = remove_query_arg('cat', $redirect['query']);
     
    137137                                // Strip off paging and feed
    138138                                $paged_redirect['path'] = preg_replace('#/page/[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing paging
    139                                 $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $paged_redirect['path']); // strip off feed endings
     139                                $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+)?$#', '/', $paged_redirect['path']); // strip off feed endings
    140140                                $paged_redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing comment paging
    141141                        }
  • tags/2.7/wp-includes/capabilities.php

    r10539 r10539  
    534534                $this->allcaps = array();
    535535                foreach ( (array) $this->roles as $role ) {
    536                         $role =& $wp_roles->get_role( $role );
     536                        $role = $wp_roles->get_role( $role );
    537537                        $this->allcaps = array_merge( $this->allcaps, $role->capabilities );
    538538                }
  • tags/2.7/wp-includes/category-template.php

    r10539 r10539  
    398398                if ( $show_option_all ) {
    399399                        $show_option_all = apply_filters( 'list_cats', $show_option_all );
    400                         $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
    401                         $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
     400                        $output .= "\t<option value='0'>$show_option_all</option>\n";
    402401                }
    403402
    404403                if ( $show_option_none ) {
    405404                        $show_option_none = apply_filters( 'list_cats', $show_option_none );
    406                         $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : '';
    407                         $output .= "\t<option value='-1'$selected>$show_option_none</option>\n";
     405                        $output .= "\t<option value='-1'>$show_option_none</option>\n";
    408406                }
    409407
     
    446444 *     'child_of' (int) default is 0 - See {@link get_categories()}.
    447445 *     'exclude' (string) - See {@link get_categories()}.
    448  *     'exclude_tree' (string) - See {@link get_categories()}.
    449446 *     'echo' (bool|int) default is 1 - Whether to display or retrieve content.
    450447 *     'current_category' (int) - See {@link get_categories()}.
     
    465462                'hide_empty' => 1, 'use_desc_for_title' => 1,
    466463                'child_of' => 0, 'feed' => '', 'feed_type' => '',
    467                 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0,
     464                'feed_image' => '', 'exclude' => '', 'current_category' => 0,
    468465                'hierarchical' => true, 'title_li' => __( 'Categories' ),
    469466                'echo' => 1, 'depth' => 0
     
    478475        if ( isset( $r['show_date'] ) ) {
    479476                $r['include_last_update_time'] = $r['show_date'];
    480         }
    481 
    482         if ( true == $r['hierarchical'] ) {
    483                 $r['exclude_tree'] = $r['exclude'];
    484                 $r['exclude'] = '';
    485477        }
    486478
     
    545537 * be to return the top 45 tags in the tag cloud list.
    546538 *
    547  * The 'topic_count_text_callback' argument is a function, which, given the count
     539* The 'topic_count_text_callback' argument is a function, which, given the count
    548540 * of the posts  with that tag, returns a text for the tooltip of the tag link.
     541 * @see default_topic_count_text
    549542 *
    550543 * The 'exclude' and 'include' arguments are used for the {@link get_tags()}
     
    621614 * The 'topic_count_text_callback' argument is a function, which given the count
    622615 * of the posts  with that tag returns a text for the tooltip of the tag link.
     616 * @see default_topic_count_text
     617 *
    623618 *
    624619 * @todo Complete functionality.
     
    655650                uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
    656651        else
    657                 uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
     652                uasort( $tags, create_function('$a, $b', 'return ($a->count < $b->count);') );
    658653
    659654        if ( 'DESC' == $order )
     
    726721 */
    727722function walk_category_tree() {
     723        $walker = new Walker_Category;
    728724        $args = func_get_args();
    729         // the user's options are the third parameter
    730         if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
    731                 $walker = new Walker_Category;
    732         else
    733                 $walker = $args[2]['walker'];
    734 
    735725        return call_user_func_array(array( &$walker, 'walk' ), $args );
    736726}
     
    744734 */
    745735function walk_category_dropdown_tree() {
     736        $walker = new Walker_CategoryDropdown;
    746737        $args = func_get_args();
    747         // the user's options are the third parameter
    748         if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
    749                 $walker = new Walker_CategoryDropdown;
    750         else
    751                 $walker = $args[2]['walker'];
    752 
    753738        return call_user_func_array(array( &$walker, 'walk' ), $args );
    754739}
  • tags/2.7/wp-includes/class-phpmailer.php

    r10539 r10539  
    14101410  function EncodeQ ($str, $position = 'text') {
    14111411    /* There should not be any EOL in the string */
    1412     $encoded = preg_replace("/[\r\n]/", '', $str);
     1412    $encoded = preg_replace("[\r\n]", '', $str);
    14131413
    14141414    switch (strtolower($position)) {
  • tags/2.7/wp-includes/comment-template.php

    r10539 r10539  
    834834
    835835        $overridden_cpage = FALSE;
    836         if ( '' == get_query_var('cpage') && get_option('page_comments') ) {
    837                 set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );
     836        if ( '' == get_query_var('cpage') && get_option('page_comments') && 'newest' == get_option('default_comments_page') ) {
     837                set_query_var( 'cpage', get_comment_pages_count() );
    838838                $overridden_cpage = TRUE;
    839839        }
     
    987987                $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';
    988988        else
    989                 $link = "<a rel='nofollow' class='comment-reply-link' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     989                $link = "<a rel='nofollow' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
    990990        return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post);
    991991}
     
    10381038                $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';
    10391039        } else {
    1040                 $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     1040                $link = "<a rel='nofollow' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
    10411041        }
    10421042        return apply_filters('post_comments_link', $before . $link . $after, $post);
  • tags/2.7/wp-includes/comment.php

    r10539 r10539  
    4646                return false; // If moderation is set to manual
    4747
    48         if ( get_option('comment_max_links') && preg_match_all("/<[Aa][^>]*[Hh][Rr][Ee][Ff]=['\"]([^\"'>]+)[^>]*>/", apply_filters('comment_text',$comment), $out) >= get_option('comment_max_links') )
     48        if ( get_option('comment_max_links') && preg_match_all("|(href\t*?=\t*?['\"]?)?(https?:)?//|i", apply_filters('comment_text', $comment), $out) >= get_option('comment_max_links') )
    4949                return false; // Check # of external links
    5050
     
    593593
    594594        // Count comments older than this one
    595         $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
     595        $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
    596596
    597597        // No older comments? Then it's page #1.
     
    15811581 */
    15821582function _close_comments_for_old_posts( $posts ) {
    1583         if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') )
     1583        if ( empty($posts) || !is_single() || !get_option('close_comments_for_old_posts') )
    15841584                return $posts;
    15851585
  • tags/2.7/wp-includes/compat.php

    r10539 r10539  
    9797}
    9898
    99 if ( !function_exists( 'htmlspecialchars_decode' ) ) {
    100         // Added in PHP 5.1.0
    101         // Error checks from PEAR::PHP_Compat
    102         function htmlspecialchars_decode( $str, $quote_style = ENT_COMPAT )
    103         {
    104                 if ( !is_scalar( $string ) ) {
    105                         trigger_error( 'htmlspecialchars_decode() expects parameter 1 to be string, ' . gettype( $string ) . ' given', E_USER_WARNING );
    106                         return;
    107                 }
    108 
    109                 if ( !is_int( $quote_style ) && $quote_style !== null ) {
    110                         trigger_error( 'htmlspecialchars_decode() expects parameter 2 to be integer, ' . gettype( $quote_style ) . ' given', E_USER_WARNING );
    111                         return;
    112                 }
    113 
    114                 return wp_specialchars_decode( $str, $quote_style );
    115         }
    116 }
    117 
    11899?>
  • tags/2.7/wp-includes/cron.php

    r10539 r10539  
    1717 *
    1818 * @param int $timestamp Timestamp for when to run the event.
    19  * @param string $hook Action hook to execute when cron is run.
    20  * @param array $args Optional. Arguments to pass to the hook's callback function.
     19 * @param callback $hook Function or method to call, when cron is run.
     20 * @param array $args Optional. Arguments to pass to the hook function.
    2121 */
    2222function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
     
    4444 * @param int $timestamp Timestamp for when to run the event.
    4545 * @param string $recurrence How often the event should recur.
    46  * @param string $hook Action hook to execute when cron is run.
    47  * @param array $args Optional. Arguments to pass to the hook's callback function.
     46 * @param callback $hook Function or method to call, when cron is run.
     47 * @param array $args Optional. Arguments to pass to the hook function.
    4848 * @return bool|null False on failure, null when complete with scheduling event.
    4949 */
     
    6666 * @param int $timestamp Timestamp for when to run the event.
    6767 * @param string $recurrence How often the event should recur.
    68  * @param string $hook Action hook to execute when cron is run.
    69  * @param array $args Optional. Arguments to pass to the hook's callback function.
     68 * @param callback $hook Function or method to call, when cron is run.
     69 * @param array $args Optional. Arguments to pass to the hook function.
    7070 * @return bool|null False on failure. Null when event is rescheduled.
    7171 */
     
    101101 *
    102102 * @param int $timestamp Timestamp for when to run the event.
    103  * @param string $hook Action hook, the execution of which will be unscheduled.
    104  * @param array $args Arguments to pass to the hook's callback function.
    105  * Although not passed to a callback function, these arguments are used
    106  * to uniquely identify the scheduled event, so they should be the same
    107  * as those used when originally scheduling the event.
     103 * @param callback $hook Function or method to call, when cron is run.
     104 * @param array $args Optional. Arguments to pass to the hook function.
    108105 */
    109106function wp_unschedule_event( $timestamp, $hook, $args = array() ) {
     
    123120 * @since 2.1.0
    124121 *
    125  * @param string $hook Action hook, the execution of which will be unscheduled.
     122 * @param callback $hook Function or method to call, when cron is run.
    126123 * @param mixed $args,... Optional. Event arguments.
    127124 */
     
    138135 * @since 2.1.0
    139136 *
    140  * @param string $hook Action hook to execute when cron is run.
    141  * @param array $args Optional. Arguments to pass to the hook's callback function.
     137 * @param callback $hook Function or method to call, when cron is run.
     138 * @param array $args Optional. Arguments to pass to the hook function.
    142139 * @return bool|int The UNIX timestamp of the next time the scheduled event will occur.
    143140 */
     
    284281 * @since 2.1.0
    285282 *
    286  * @param string $hook Action hook to execute when cron is run.
    287  * @param array $args Optional. Arguments to pass to the hook's callback function.
     283 * @param callback $hook Function or method to call, when cron is run.
     284 * @param array $args Optional. Arguments to pass to the hook function.
    288285 * @return string|bool False, if no schedule. Schedule on success.
    289286 */
  • tags/2.7/wp-includes/feed-atom-comments.php

    r10539 r10539  
    1212        xmlns="http://www.w3.org/2005/Atom"
    1313        xml:lang="<?php echo get_option('rss_language'); ?>"
    14         xmlns:thr="http://purl.org/syndication/thread/1.0"
    1514        <?php do_action('atom_ns'); ?>
    1615>
     
    6564                </author>
    6665
    67                 <id><?php comment_guid(); ?></id>
     66                <id><?php comment_link(); ?></id>
    6867                <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated>
    6968                <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published>
     
    8079        // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system
    8180?>
    82                 <thr:in-reply-to ref="<?php comment_guid($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
     81                <thr:in-reply-to ref="<?php echo get_comment_link($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
    8382<?php endif;
    8483        do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID);
  • tags/2.7/wp-includes/feed.php

    r10539 r10539  
    224224 * @subpackage Feed
    225225 * @since unknown
    226  *
    227  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
    228  */
    229 function comment_guid($comment_id = null) {
    230         echo get_comment_guid($comment_id);
     226 */
     227function comment_guid() {
     228        echo get_comment_guid();
    231229}
    232230
     
    238236 * @since unknown
    239237 *
    240  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
    241238 * @return bool|string false on failure or guid for comment on success.
    242239 */
    243 function get_comment_guid($comment_id = null) {
    244         $comment = get_comment($comment_id);
     240function get_comment_guid() {
     241        global $comment;
    245242
    246243        if ( !is_object($comment) )
     
    256253 */
    257254function comment_link() {
    258         echo clean_url( get_comment_link() );
     255        echo get_comment_link();
    259256}
    260257
  • tags/2.7/wp-includes/formatting.php

    r10539 r10539  
    187187 * Converts a number of special characters into their HTML entities.
    188188 *
    189  * Specifically deals with: &, <, >, ", and '.
    190  *
    191  * $quote_style can be set to ENT_COMPAT to encode " to
    192  * &quot;, or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded.
     189 * Differs from htmlspecialchars as existing HTML entities will not be encoded.
     190 * Specifically changes: & to &#038;, < to &lt; and > to &gt;.
     191 *
     192 * $quotes can be set to 'single' to encode ' to &#039;, 'double' to encode " to
     193 * &quot;, or '1' to do both. Default is 0 where no quotes are encoded.
    193194 *
    194195 * @since 1.2.2
    195196 *
    196  * @param string $string The text which is to be encoded.
    197  * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
    198  * @param string $charset Optional. The character encoding of the string. Default is false.
    199  * @param boolean $double_encode Optional. Whether or not to encode existing html entities. Default is false.
     197 * @param string $text The text which is to be encoded.
     198 * @param mixed $quotes Optional. Converts single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default 0.
    200199 * @return string The encoded text with HTML entities.
    201200 */
    202 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
    203 {
    204         $string = (string) $string;
    205 
    206         if ( 0 === strlen( $string ) ) {
    207                 return '';
    208         }
    209 
    210         // Don't bother if there are no specialchars - saves some processing
    211         if ( !preg_match( '/[&<>"\']/', $string ) ) {
    212                 return $string;
    213         }
    214 
    215         // Account for the previous behaviour of the function when the $quote_style is not an accepted value
    216         if ( empty( $quote_style ) ) {
    217                 $quote_style = ENT_NOQUOTES;
    218         } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
    219                 $quote_style = ENT_QUOTES;
    220         }
    221 
    222         // Store the site charset as a static to avoid multiple calls to wp_load_alloptions()
    223         if ( !$charset ) {
    224                 static $_charset;
    225                 if ( !isset( $_charset ) ) {
    226                         $alloptions = wp_load_alloptions();
    227                         $_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : '';
    228                 }
    229                 $charset = $_charset;
    230         }
    231         if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) {
    232                 $charset = 'UTF-8';
    233         }
    234 
    235         $_quote_style = $quote_style;
    236 
    237         if ( $quote_style === 'double' ) {
    238                 $quote_style = ENT_COMPAT;
    239                 $_quote_style = ENT_COMPAT;
    240         } elseif ( $quote_style === 'single' ) {
    241                 $quote_style = ENT_NOQUOTES;
    242         }
    243 
    244         // Handle double encoding ourselves
    245         if ( !$double_encode ) {
    246                 $string = wp_specialchars_decode( $string, $_quote_style );
    247                 $string = preg_replace( '/&(#?x?[0-9]+|[a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string );
    248         }
    249 
    250         $string = @htmlspecialchars( $string, $quote_style, $charset );
    251 
    252         // Handle double encoding ourselves
    253         if ( !$double_encode ) {
    254                 $string = str_replace( array( '|wp_entity|', '|/wp_entity|' ), array( '&', ';' ), $string );
    255         }
    256 
    257         // Backwards compatibility
    258         if ( 'single' === $_quote_style ) {
    259                 $string = str_replace( "'", '&#039;', $string );
    260         }
    261 
    262         return $string;
    263 }
    264 
    265 /**
    266  * Converts a number of HTML entities into their special characters.
    267  *
    268  * Specifically deals with: &, <, >, ", and '.
    269  *
    270  * $quote_style can be set to ENT_COMPAT to decode " entities,
    271  * or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded.
    272  *
    273  * @since 2.8
    274  *
    275  * @param string $string The text which is to be decoded.
    276  * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old wp_specialchars() values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
    277  * @return string The decoded text without HTML entities.
    278  */
    279 function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES )
    280 {
    281         $string = (string) $string;
    282 
    283         if ( 0 === strlen( $string ) ) {
    284                 return '';
    285         }
    286 
    287         // Don't bother if there are no entities - saves a lot of processing
    288         if ( strpos( $string, '&' ) === false ) {
    289                 return $string;
    290         }
    291 
    292         // Match the previous behaviour of wp_specialchars() when the $quote_style is not an accepted value
    293         if ( empty( $quote_style ) ) {
    294                 $quote_style = ENT_NOQUOTES;
    295         } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
    296                 $quote_style = ENT_QUOTES;
    297         }
    298 
    299         // More complete than get_html_translation_table( HTML_SPECIALCHARS )
    300         $single = array( '&#039;'  => '\'', '&#x27;' => '\'' );
    301         $single_preg = array( '/&#0*39;/'  => '&#039;', '/&#x0*27;/i' => '&#x27;' );
    302         $double = array( '&quot;' => '"', '&#034;'  => '"', '&#x22;' => '"' );
    303         $double_preg = array( '/&#0*34;/'  => '&#034;', '/&#x0*22;/i' => '&#x22;' );
    304         $others = array( '&lt;'   => '<', '&#060;'  => '<', '&gt;'   => '>', '&#062;'  => '>', '&amp;'  => '&', '&#038;'  => '&', '&#x26;' => '&' );
    305         $others_preg = array( '/&#0*60;/'  => '&#060;', '/&#0*62;/'  => '&#062;', '/&#0*38;/'  => '&#038;', '/&#x0*26;/i' => '&#x26;' );
    306 
    307         if ( $quote_style === ENT_QUOTES ) {
    308                 $translation = array_merge( $single, $double, $others );
    309                 $translation_preg = array_merge( $single_preg, $double_preg, $others_preg );
    310         } elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) {
    311                 $translation = array_merge( $double, $others );
    312                 $translation_preg = array_merge( $double_preg, $others_preg );
    313         } elseif ( $quote_style === 'single' ) {
    314                 $translation = array_merge( $single, $others );
    315                 $translation_preg = array_merge( $single_preg, $others_preg );
    316         } elseif ( $quote_style === ENT_NOQUOTES ) {
    317                 $translation = $others;
    318                 $translation_preg = $others_preg;
    319         }
    320 
    321         // Remove zero padding on numeric entities
    322         $string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string );
    323 
    324         // Replace characters according to translation table
    325         return strtr( $string, $translation );
    326 }
    327 
    328 /**
    329  * Checks for invalid UTF8 in a string.
    330  *
    331  * @since 2.8
    332  *
    333  * @param string $string The text which is to be checked.
    334  * @param boolean $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false.
    335  * @return string The checked text.
    336  */
    337 function wp_check_invalid_utf8( $string, $strip = false )
    338 {
    339         $string = (string) $string;
    340 
    341         if ( 0 === strlen( $string ) ) {
    342                 return '';
    343         }
    344 
    345         // Store the site charset as a static to avoid multiple calls to get_option()
    346         static $is_utf8;
    347         if ( !isset( $is_utf8 ) ) {
    348                 $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );
    349         }
    350         if ( !$is_utf8 ) {
    351                 return $string;
    352         }
    353 
    354         // Check for support for utf8 in the installed PCRE library once and store the result in a static
    355         static $utf8_pcre;
    356         if ( !isset( $utf8_pcre ) ) {
    357                 $utf8_pcre = @preg_match( '/^./u', 'a' );
    358         }
    359         // We can't demand utf8 in the PCRE installation, so just return the string in those cases
    360         if ( !$utf8_pcre ) {
    361                 return $string;
    362         }
    363 
    364         // preg_match fails when it encounters invalid UTF8 in $string
    365         if ( 1 === @preg_match( '/^./us', $string ) ) {
    366                 return $string;
    367         }
    368 
    369         // Attempt to strip the bad chars if requested (not recommended)
    370         if ( $strip && function_exists( 'iconv' ) ) {
    371                 return iconv( 'utf-8', 'utf-8', $string );
    372         }
    373 
    374         return '';
     201function wp_specialchars( $text, $quotes = 0 ) {
     202        // Like htmlspecialchars except don't double-encode HTML entities
     203        $text = str_replace('&&', '&#038;&', $text);
     204        $text = str_replace('&&', '&#038;&', $text);
     205        $text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&#038;$1', $text);
     206        $text = str_replace('<', '&lt;', $text);
     207        $text = str_replace('>', '&gt;', $text);
     208        if ( 'double' === $quotes ) {
     209                $text = str_replace('"', '&quot;', $text);
     210        } elseif ( 'single' === $quotes ) {
     211                $text = str_replace("'", '&#039;', $text);
     212        } elseif ( $quotes ) {
     213                $text = str_replace('"', '&quot;', $text);
     214                $text = str_replace("'", '&#039;', $text);
     215        }
     216        return $text;
    375217}
    376218
     
    13061148        } else {
    13071149                $subject = str_replace('_', ' ', $matches[2]);
    1308                 $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject);
     1150                /** @todo use preg_replace_callback() */
     1151                $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject);
    13091152                return $subject;
    13101153        }
     
    13151158 *
    13161159 * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the
    1317  * value of the 'gmt_offset' option.
     1160 * value of gmt_offset.
    13181161 *
    13191162 * @since 1.2.0
    13201163 *
    1321  * @uses get_option() to retrieve the the value of 'gmt_offset'.
    13221164 * @param string $string The date to be converted.
    13231165 * @return string GMT version of the date provided.
     
    19011743 */
    19021744function js_escape($text) {
    1903         $safe_text = wp_check_invalid_utf8( $text );
    1904         $safe_text = wp_specialchars( $safe_text, ENT_COMPAT );
    1905         $safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) );
    1906         $safe_text = preg_replace( "/\r?\n/", "\\n", addslashes( $safe_text ) );
    1907         return apply_filters( 'js_escape', $safe_text, $text );
     1745        $safe_text = wp_specialchars($text, 'double');
     1746        $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
     1747        $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
     1748        return apply_filters('js_escape', $safe_text, $text);
    19081749}
    19091750
     
    19161757 * @return string
    19171758 */
    1918 function attribute_escape( $text ) {
    1919         $safe_text = wp_check_invalid_utf8( $text );
    1920         $safe_text = wp_specialchars( $safe_text, ENT_QUOTES );
    1921         return apply_filters( 'attribute_escape', $safe_text, $text );
     1759function attribute_escape($text) {
     1760        $safe_text = wp_specialchars($text, true);
     1761        return apply_filters('attribute_escape', $safe_text, $text);
    19221762}
    19231763
     
    19311771 */
    19321772function tag_escape($tag_name) {
    1933         $safe_tag = strtolower( preg_replace('/[^a-zA-Z_:]/', '', $tag_name) );
     1773        $safe_tag = strtolower( preg_replace('[^a-zA-Z_:]', '', $tag_name) );
    19341774        return apply_filters('tag_escape', $safe_tag, $tag_name);
    19351775}
  • tags/2.7/wp-includes/functions.php

    r10539 r10539  
    8080 * The 'timestamp' type will return the current timestamp.
    8181 *
    82  * If $gmt is set to either '1' or 'true', then both types will use GMT time.
    83  * if $gmt is false, the output is adjusted with the GMT offset in the WordPress option.
     82 * If the $gmt is set to either '1' or 'true', then both types will use the
     83 * GMT offset in the WordPress option to add the GMT offset to the time.
    8484 *
    8585 * @since 1.0.0
    8686 *
    8787 * @param string $type Either 'mysql' or 'timestamp'.
    88  * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false.
     88 * @param int|bool $gmt Optional. Whether to use $gmt offset. Default is false.
    8989 * @return int|string String if $type is 'gmt', int if $type is 'timestamp'.
    9090 */
     
    28052805 */
    28062806function is_ssl() {
    2807         if ( isset($_SERVER['HTTPS']) ) {
    2808                 if ( 'on' == strtolower($_SERVER['HTTPS']) )
    2809                         return true;
    2810                 if ( '1' == $_SERVER['HTTPS'] )
    2811                         return true;
    2812         } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
    2813                 return true;
    2814         }
    2815         return false;
     2807        return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
    28162808}
    28172809
     
    29062898 * @return object The cloned object
    29072899 */
    2908 function wp_clone( $object ) {
    2909         static $can_clone;
    2910         if ( !isset( $can_clone ) ) {
    2911                 $can_clone = version_compare( phpversion(), '5.0', '>=' );
    2912         }
    2913         return $can_clone ? clone( $object ) : $object;
     2900function wp_clone($object) {
     2901        return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
    29142902}
    29152903
  • tags/2.7/wp-includes/general-template.php

    r10539 r10539  
    15931593
    15941594        if ( $lang = get_bloginfo('language') ) {
    1595                 if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
     1595                if ( get_option('html_type') == 'text/html' || $doctype == 'xhtml' )
    15961596                        $attributes[] = "lang=\"$lang\"";
    15971597
  • tags/2.7/wp-includes/http.php

    r10539 r10539  
    243243
    244244                if ( is_null($r['body']) ) {
    245                         // Some servers fail when sending content without the content-length
    246                         // header being set.
    247                         $r['headers']['Content-Length'] = 0;
    248245                        $transports = WP_Http::_getTransport($r);
    249246                } else {
     
    394391         *
    395392         * @param string $body Body content
    396          * @return string Chunked decoded body on success or raw body on failure.
     393         * @return bool|string|WP_Error False if not chunked encoded. WP_Error on failure. Chunked decoded body on success.
    397394         */
    398395        function chunkTransferDecode($body) {
     
    405402                //$parsedHeaders = array(); Unsupported
    406403
    407                 while ( true ) {
     404                $done = false;
     405
     406                do {
    408407                        $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match );
    409408
    410409                        if ( $hasChunk ) {
    411                                 if ( empty($match[1]) )
    412                                         return $body;
     410                                if ( empty($match[1]) ) {
     411                                        return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') );
     412                                }
    413413
    414414                                $length = hexdec( $match[1] );
     
    420420                                $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n");
    421421
    422                                 if( "0" == trim($body) )
     422                                if( "0" == trim($body) ) {
     423                                        $done = true;
    423424                                        return $parsedBody; // Ignore footer headers.
     425                                        break;
     426                                }
    424427                        } else {
    425                                 return $body;
     428                                return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') );
    426429                        }
    427                 }
     430                } while ( false === $done );
    428431        }
    429432}
     
    642645                        return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url));
    643646
    644                 if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] )
     647                if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
    645648                        $url = str_replace($arrURL['scheme'], 'http', $url);
    646649
     
    748751                        return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url));
    749752
    750                 if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] )
     753                if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
    751754                        $url = str_replace($arrURL['scheme'], 'http', $url);
    752755
     
    775778                $context = stream_context_create($arrContext);
    776779
    777                 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
     780                if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
    778781                        $handle = @fopen($url, 'r', false, $context);
    779782                else
     
    980983                }
    981984
    982                 // cURL extension will sometimes fail when the timeout is less than 1 as
    983                 // it may round down to 0, which gives it unlimited timeout.
     985                // If timeout is a float less than 1, round it up to 1.
    984986                if ( $r['timeout'] > 0 && $r['timeout'] < 1 )
    985987                        $r['timeout'] = 1;
     
    988990                curl_setopt( $handle, CURLOPT_URL, $url);
    989991
    990                 // The cURL extension requires that the option be set for the HEAD to
    991                 // work properly.
    992992                if ( 'HEAD' === $r['method'] ) {
    993993                        curl_setopt( $handle, CURLOPT_NOBODY, true );
     
    10081008                curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] );
    10091009
    1010                 // The option doesn't work with safe mode or when open_basedir is set.
    10111010                if ( !ini_get('safe_mode') && !ini_get('open_basedir') )
    10121011                        curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true );
     
    10641063         */
    10651064        function test() {
    1066                 if ( function_exists('curl_init') && function_exists('curl_exec') )
     1065                if ( function_exists('curl_init') )
    10671066                        return true;
    10681067
  • tags/2.7/wp-includes/js/autosave.js

    r10539 r10539  
    115115
    116116function autosave_enable_buttons() {
    117         jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr('disabled', '');
     117        jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', '');
    118118}
    119119
    120120function autosave_disable_buttons() {
    121         jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr('disabled', 'disabled');
     121        jQuery("#submitpost :button:enabled, #submitpost :submit:enabled").attr('disabled', 'disabled');
    122122        setTimeout(autosave_enable_buttons, 5000); // Re-enable 5 sec later.  Just gives autosave a head start to avoid collisions.
    123123}
  • tags/2.7/wp-includes/js/thickbox/thickbox.css

    r10539 r10539  
    3434.TB_overlayBG {
    3535        background-color:#000;
    36         -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)";
    3736        filter:alpha(opacity=75);
    3837        -moz-opacity: 0.75;
  • tags/2.7/wp-includes/js/thickbox/thickbox.js

    r10539 r10539  
    282282
    283283function tb_position() {
    284 var isIE6 = typeof document.body.style.maxHeight === "undefined";
    285284jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
    286         if ( ! isIE6 ) { // take away IE6
     285        if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
    287286                jQuery("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
    288287        }
  • tags/2.7/wp-includes/js/wp-ajax-response.js

    r10539 r10539  
    1 var wpAjax = jQuery.extend( {
     1wpAjax = jQuery.extend( {
    22        unserialize: function( s ) {
    33                var r = {}; if ( !s ) { return r; }
  • tags/2.7/wp-includes/kses.php

    r10539 r10539  
    395395 */
    396396function wp_kses_split($string, $allowed_html, $allowed_protocols) {
    397         global $pass_allowed_html, $pass_allowed_protocols;
    398         $pass_allowed_html = $allowed_html;
    399         $pass_allowed_protocols = $allowed_protocols;
    400         return preg_replace_callback('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%',
    401                 create_function('$match', 'global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);'), $string);
     397        return preg_replace('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%e',
     398        "wp_kses_split2('\\1', \$allowed_html, ".'$allowed_protocols)', $string);
    402399}
    403400
     
    10031000 */
    10041001function wp_kses_decode_entities($string) {
    1005         $string = preg_replace_callback('/&#([0-9]+);/', create_function('$match', 'return chr($match[1]);'), $string);
    1006         $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', create_function('$match', 'return chr(hexdec($match[1]));'), $string);
     1002        $string = preg_replace('/&#([0-9]+);/e', 'chr("\\1")', $string);
     1003        $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', 'chr(hexdec("\\1"))', $string);
    10071004
    10081005        return $string;
  • tags/2.7/wp-includes/link-template.php

    r10539 r10539  
    9393        );
    9494
    95         if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter )
    96                 $post = $id;
    97         else
    98                 $post = &get_post($id);
     95        $post = &get_post($id);
    9996
    10097        if ( empty($post->ID) ) return false;
     
    726723        }
    727724
    728         $link = '<a class="post-edit-link" href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>';
     725        $link = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>';
    729726        echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
    730727}
     
    776773        }
    777774
    778         $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
     775        $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
    779776        echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
    780777}
     
    12461243
    12471244/**
    1248  * Return the link to next comments pages.
    1249  *
    1250  * @since 2.7.1
     1245 * Display link to next comments pages.
     1246 *
     1247 * @since 2.7.0
    12511248 *
    12521249 * @param string $label Optional. Label for link text.
    12531250 * @param int $max_page Optional. Max page.
    1254  * @return string|null
    1255  */
    1256 function get_next_comments_link( $label = '', $max_page = 0 ) {
     1251 */
     1252function next_comments_link($label='', $max_page = 0) {
    12571253        global $wp_query;
    12581254
     
    12621258        $page = get_query_var('cpage');
    12631259
     1260        if ( !$page )
     1261                $page = 1;
     1262
    12641263        $nextpage = intval($page) + 1;
    12651264
     
    12761275                $label = __('Newer Comments &raquo;');
    12771276
    1278         return '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
    1279 }
    1280 
    1281 /**
    1282  * Display the link to next comments pages.
     1277        echo '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) );
     1278        $attr = apply_filters( 'next_comments_link_attributes', '' );
     1279        echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
     1280}
     1281
     1282/**
     1283 * Display the previous comments page link.
    12831284 *
    12841285 * @since 2.7.0
    12851286 *
    1286  * @param string $label Optional. Label for link text.
    1287  * @param int $max_page Optional. Max page.
    1288  */
    1289 function next_comments_link( $label = '', $max_page = 0 ) {
    1290         echo get_next_comments_link( $label, $max_page );
    1291 }
    1292 
    1293 /**
    1294  * Return the previous comments page link.
    1295  *
    1296  * @since 2.7.1
    1297  *
    12981287 * @param string $label Optional. Label for comments link text.
    1299  * @return string|null
    1300  */
    1301 function get_previous_comments_link( $label = '' ) {
     1288 */
     1289function previous_comments_link($label='') {
     1290
    13021291        if ( !is_singular() )
    13031292                return;
     
    13051294        $page = get_query_var('cpage');
    13061295
    1307         if ( intval($page) <= 1 )
     1296        if ( !$page )
     1297                $page = 1;
     1298
     1299        if ( $page <= 1 )
    13081300                return;
    13091301
     
    13131305                $label = __('&laquo; Older Comments');
    13141306
    1315         return '<a href="' . clean_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
    1316 }
    1317 
    1318 /**
    1319  * Display the previous comments page link.
    1320  *
    1321  * @since 2.7.0
    1322  *
    1323  * @param string $label Optional. Label for comments link text.
    1324  */
    1325 function previous_comments_link( $label = '' ) {
    1326         echo get_previous_comments_link( $label );
     1307        echo '<a href="' . clean_url(get_comments_pagenum_link($prevpage));
     1308        $attr = apply_filters( 'previous_comments_link_attributes', '' );
     1309        echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
    13271310}
    13281311
     
    13551338        );
    13561339        if ( $wp_rewrite->using_permalinks() )
    1357                 $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged');
     1340                $defaults['base'] = user_trailingslashit(get_permalink() . 'comment-page-%#%', 'commentpaged');
    13581341
    13591342        $args = wp_parse_args( $args, $defaults );
  • tags/2.7/wp-includes/pluggable.php

    r10539 r10539  
    12111211 * You must not copy the below example and paste into your wp-config.php. If you
    12121212 * need an example, then you can have a
    1213  * {@link https://api.wordpress.org/secret-key/1.1/ secret key created} for you.
     1213 * {@link http://api.wordpress.org/secret-key/1.0/ secret key created} for you.
    12141214 *
    12151215 * <code>
     
    12221222 *
    12231223 * @since 2.5
    1224  * @link https://api.wordpress.org/secret-key/1.1/ Create a Secret Key for wp-config.php
     1224 * @link http://api.wordpress.org/secret-key/1.0/ Create a Secret Key for wp-config.php
    12251225 *
    12261226 * @return string Salt value from either 'SECRET_KEY' or 'secret' option
     
    13951395 * @since 2.5
    13961396 *
    1397  * @param int $length The length of password to generate
    1398  * @param bool $special_chars Whether to include standard special characters
    13991397 * @return string The random password
    14001398 **/
     
    15301528        }
    15311529
    1532         if ( is_ssl() )
    1533                 $host = 'https://secure.gravatar.com';
    1534         else
    1535                 $host = 'http://www.gravatar.com';
    1536 
    15371530        if ( 'mystery' == $default )
    1538                 $default = "$host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
     1531                $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
    15391532        elseif ( 'blank' == $default )
    15401533                $default = includes_url('images/blank.gif');
     
    15421535                $default = '';
    15431536        elseif ( 'gravatar_default' == $default )
    1544                 $default = "$host/avatar/s={$size}";
     1537                $default = "http://www.gravatar.com/avatar/s={$size}";
    15451538        elseif ( empty($email) )
    1546                 $default = "$host/avatar/?d=$default&amp;s={$size}";
     1539                $default = "http://www.gravatar.com/avatar/?d=$default&amp;s={$size}";
    15471540        elseif ( strpos($default, 'http://') === 0 )
    15481541                $default = add_query_arg( 's', $size, $default );
    15491542
    15501543        if ( !empty($email) ) {
    1551                 $out = "$host/avatar/";
     1544                $out = 'http://www.gravatar.com/avatar/';
    15521545                $out .= md5( strtolower( $email ) );
    15531546                $out .= '?s='.$size;
  • tags/2.7/wp-includes/post-template.php

    r10539 r10539  
    224224        }
    225225        if ( $preview ) // preview fix for javascript bug with foreign languages
    226                 $output =       preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);
     226                $output =       preg_replace('/\%u([0-9A-F]{4,4})/e',   "'&#'.base_convert('\\1',16,10).';'", $output);
    227227
    228228        return $output;
     
    608608
    609609        // sanitize, mostly to keep spaces out
    610         $r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']);
     610        $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
    611611
    612612        // Allow plugins to filter an array of excluded pages
     
    681681                if ( is_front_page() && !is_paged() )
    682682                        $class = 'class="current_page_item"';
    683                 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
     683                $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $link_before . $text . $link_after . '</a></li>';
    684684                // If the front page is a page, add it to the exclude list
    685685                if (get_option('show_on_front') == 'page') {
     
    10491049        $currentf  = __( '%s [Current Revision]' );
    10501050
    1051         $date = date_i18n( $datef, strtotime( $revision->post_modified ) );
     1051        $date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) );
    10521052        if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
    10531053                $date = "<a href='$link'>$date</a>";
  • tags/2.7/wp-includes/post.php

    r10539 r10539  
    216216                else
    217217                        return $null;
    218         } elseif ( is_object($post) && empty($post->filter) ) {
     218        } elseif ( is_object($post) ) {
    219219                _get_post_ancestors($post);
    220220                wp_cache_add($post->ID, $post, 'posts');
    221221                $_post = &$post;
    222222        } else {
    223                 if ( is_object($post) )
    224                         $post = $post->ID;
    225223                $post = (int) $post;
    226224                if ( ! $_post = wp_cache_get($post, 'posts') ) {
     
    742740        $custom = get_post_custom($post_id);
    743741
    744         return isset($custom[$key]) ? $custom[$key] : null;
     742        return $custom[$key];
    745743}
    746744
     
    795793                foreach ( array_keys(get_object_vars($post)) as $field )
    796794                        $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
    797                 $post->filter = $context;
    798795        } else {
    799796                if ( !isset($post['ID']) )
     
    801798                foreach ( array_keys($post) as $field )
    802799                        $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
    803                 $post['filter'] = $context;
    804         }
    805 
     800        }
    806801        return $post;
    807802}
     
    25412536                        if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location
    25422537                                $url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); //replace file location with url location
    2543                         elseif ( false !== strpos($file, 'wp-content/uploads') )
    2544                                 $url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 );
    2545                         else
    2546                                 $url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.
    25472538                }
    25482539        }
  • tags/2.7/wp-includes/script-loader.php

    r10539 r10539  
    104104        $scripts->add( 'jquery-hotkeys', '/wp-includes/js/jquery/jquery.hotkeys.js', array('jquery'), '0.0.2' );
    105105        $scripts->add( 'jquery-table-hotkeys', '/wp-includes/js/jquery/jquery.table-hotkeys.js', array('jquery', 'jquery-hotkeys'), '20081128' );
    106         $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20090123');
     106        $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430');
    107107        $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.2.0-20081031');
    108108        $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.2.0-20081031');
  • tags/2.7/wp-includes/taxonomy.php

    r10539 r10539  
    535535 * 'exclude' is ignored.
    536536 *
    537  * 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
    539  * the primary taxonomy.  If 'include' is non-empty, 'exclude_tree' is ignored.
    540  *
    541537 * include - Default is an empty string.  A comma- or space-delimited string
    542538 * of term ids to include in the return array.
     
    609605
    610606        $defaults = array('orderby' => 'name', 'order' => 'ASC',
    611                 'hide_empty' => true, 'exclude' => '', 'exclude_tree' => '', 'include' => '',
     607                'hide_empty' => true, 'exclude' => '', 'include' => '',
    612608                'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '',
    613609                'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '',
     
    673669        if ( !empty($include) ) {
    674670                $exclude = '';
    675                 $exclude_tree = '';
    676671                $interms = preg_split('/[\s,]+/',$include);
    677672                if ( count($interms) ) {
     
    690685
    691686        $exclusions = '';
    692         if ( ! empty( $exclude_tree ) ) {
    693                 $excluded_trunks = preg_split('/[\s,]+/',$exclude_tree);
    694                 foreach( (array) $excluded_trunks as $extrunk ) {
    695                         $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids'));       
    696                         $excluded_children[] = $extrunk;
    697                         foreach( (array) $excluded_children as $exterm ) {
    698                                 if ( empty($exclusions) )
    699                                         $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' ';
    700                                 else
    701                                         $exclusions .= ' AND t.term_id <> ' . intval($exterm) . ' ';
    702 
    703                         }
    704                 }
    705         }
    706687        if ( !empty($exclude) ) {
    707688                $exterms = preg_split('/[\s,]+/',$exclude);
    708689                if ( count($exterms) ) {
    709690                        foreach ( (array) $exterms as $exterm ) {
    710                                 if ( empty($exclusions) )
     691                                if (empty($exclusions))
    711692                                        $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' ';
    712693                                else
     
    737718                $where .= ' AND tt.count > 0';
    738719
    739         // don't limit the query results when we have to descend the family tree
    740         if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' == $parent ) {
     720        if ( !empty($number) ) {
    741721                if( $offset )
    742                         $limit = 'LIMIT ' . $offset . ',' . $number;
     722                        $number = 'LIMIT ' . $offset . ',' . $number;
    743723                else
    744                         $limit = 'LIMIT ' . $number;
     724                        $number = 'LIMIT ' . $number;
    745725
    746726        } else
    747                 $limit = '';
     727                $number = '';
    748728
    749729        if ( !empty($search) ) {
     
    760740                $select_this = 't.term_id, tt.parent, tt.count, t.name';
    761741
    762         $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit";
    763 
    764         $terms = $wpdb->get_results($query);
     742        $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $number";
     743
    765744        if ( 'all' == $fields ) {
     745                $terms = $wpdb->get_results($query);
    766746                update_term_cache($terms);
     747        } else if ( ('ids' == $fields) || ('names' == $fields) ) {
     748                $terms = $wpdb->get_results($query);
    767749        }
    768750
     
    810792                        $_terms[] = $term->name;
    811793                $terms = $_terms;
    812         }
    813 
    814         if ( 0 < $number && intval(@count($terms)) > $number ) {
    815                 $terms = array_slice($terms, $offset, $number);
    816794        }
    817795
  • tags/2.7/wp-includes/theme.php

    r10539 r10539  
    850850                return;
    851851
    852         $_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']);
     852        $_GET['template'] = preg_replace('|[^a-z0-9_.-]|i', '', $_GET['template']);
    853853
    854854        if ( validate_file($_GET['template']) )
     
    858858
    859859        if ( isset($_GET['stylesheet']) ) {
    860                 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']);
     860                $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-]|i', '', $_GET['stylesheet']);
    861861                if ( validate_file($_GET['stylesheet']) )
    862862                        return;
  • tags/2.7/wp-includes/version.php

    r10539 r10539  
    99 * @global string $wp_version
    1010 */
    11 $wp_version = '2.7.1';
     11$wp_version = '2.7';
    1212
    1313/**
  • tags/2.7/wp-includes/widgets.php

    r10539 r10539  
    549549        global $wp_registered_widgets, $wp_registered_sidebars;
    550550
    551         $sidebars_widgets = get_option('sidebars_widgets', array());
     551        $sidebars_widgets = get_option('sidebars_widgets');
    552552        $_sidebars_widgets = array();
    553553
     
    619619        }
    620620
    621         if ( isset($sidebars_widgets['array_version']) )
    622                 unset($sidebars_widgets['array_version']);
     621        unset($sidebars_widgets['array_version']);
    623622
    624623        $sidebars_widgets = apply_filters('sidebars_widgets', $sidebars_widgets);
     
    14001399                        <ul id="recentcomments"><?php
    14011400                        if ( $comments ) : foreach ( (array) $comments as $comment) :
    1402                         echo  '<li class="recentcomments">' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="' . clean_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
     1401                        echo  '<li class="recentcomments">' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_comment_link($comment->comment_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
    14031402                        endforeach; endif;?></ul>
    14041403                <?php echo $after_widget; ?>
     
    20942093
    20952094// This is important
    2096 add_action( 'widgets_init', 'widget_many_register' );
     2095add_action( 'widgets_init', 'widget_many_register' )
    20972096
    20982097*/
  • tags/2.7/wp-settings.php

    r10539 r10539  
    1616        @ini_set('memory_limit', WP_MEMORY_LIMIT);
    1717
    18 set_magic_quotes_runtime(0);
    19 @ini_set('magic_quotes_sybase', 0);
    2018
    2119/**
     
    202200        error_reporting(E_ALL);
    203201} else {
    204         // Unicode Extension is in PHP 6.0 only or do version check when this changes.
    205         if ( function_exists('unicode_decode') )
    206                 error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ^ E_STRICT );
    207         else if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3
    208                 error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE );
    209         else
    210                 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
     202        error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
    211203}
    212204
  • tags/2.7/xmlrpc.php

    r10539 r10539  
    12591259                        $logged_in = true;
    12601260                        set_current_user( 0, $username );
     1261                        if ( !current_user_can( 'moderate_comments' ) )
     1262                                return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this blog.' ) );
    12611263                }
    12621264
     
    12841286                        if ( isset($content_struct['author']) )
    12851287                                $comment['comment_author'] = $content_struct['author'];
    1286 
    12871288                        $comment['comment_author_email'] = '';
    1288                         if ( isset($content_struct['author_email']) )
     1289                        if ( isset($content_struct['author']) )
    12891290                                $comment['comment_author_email'] = $content_struct['author_email'];
    1290 
    12911291                        $comment['comment_author_url'] = '';
    1292                         if ( isset($content_struct['author_url']) )
     1292                        if ( isset($content_struct['author']) )
    12931293                                $comment['comment_author_url'] = $content_struct['author_url'];
    1294 
    12951294                        $comment['user_ID'] = 0;
    12961295
     
    27632762                                $struct['categoryId'] = $cat->term_id;
    27642763                                $struct['parentId'] = $cat->parent;
    2765                                 $struct['description'] = $cat->name;
    2766                                 $struct['categoryDescription'] = $cat->description;
     2764                                $struct['description'] = $cat->description;
    27672765                                $struct['categoryName'] = $cat->name;
    27682766                                $struct['htmlUrl'] = wp_specialchars(get_category_link($cat->term_id));
Note: See TracChangeset for help on using the changeset viewer.