WordPress.org

Make WordPress Core

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


Ignore:
Location:
tags/2.7.1
Files:
65 edited

Legend:

Unmodified
Added
Removed
  • tags/2.7.1/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()); 
    433436 
    434437    foreach ( $tags as $key => $tag ) { 
     
    721724 
    722725    $data = ''; 
    723     $message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ); 
     726    $message = sprintf( __('Draft Saved at %s.'), date_i18n( __('g:i:s a') ) ); 
    724727 
    725728    $supplemental = array(); 
  • tags/2.7.1/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             wp_redirect('tools.php?page=' . $plugin_page); 
     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 ); 
    6570            exit; 
    6671        } 
  • tags/2.7.1/wp-admin/css/colors-classic.css

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

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

    r10539 r10539  
    179179} 
    180180/* end Inline Editor */ 
     181 
     182input { 
     183    line-height: 1; 
     184} 
    181185 
    182186* html .row-actions { 
     
    274278} 
    275279 
    276 #ed_toolbar input { 
     280#ed_toolbar input, 
     281#ed_reply_toolbar input { 
    277282    overflow: visible; 
    278283    padding: 0 4px; 
  • tags/2.7.1/wp-admin/css/press-this.css

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

    r10539 r10539  
    1919 
    2020    $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] ); 
    21     $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); 
    22  
     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    } 
    2326    $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam; 
    2427    if ( $post_id ) 
     
    273276 
    274277if ( 'spam' == $comment_status ) { 
    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 } ?> 
     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} ?> 
    278283<?php do_action('manage_comments_nav', $comment_status); ?> 
    279284</div> 
     
    325330<option value="unapprove"><?php _e('Unapprove'); ?></option> 
    326331<?php endif; ?> 
    327 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?> 
     332<?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status ): ?> 
    328333<option value="approve"><?php _e('Approve'); ?></option> 
    329334<?php endif; ?> 
  • tags/2.7.1/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-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" /> 
     121        <input type="button" id="category-add-submit" 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.1/wp-admin/import/blogger.php

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

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

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

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

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

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

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

    r10539 r10539  
    182182    // Posts 
    183183    $num = number_format_i18n( $num_posts->publish ); 
    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>'; 
     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>'; 
    190191    /* TODO: Show status breakdown on hover 
    191192    if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can 
     
    207208    // Total Comments 
    208209    $num = number_format_i18n($num_comm->total_comments); 
    209     if ( current_user_can( 'moderate_comments' ) ) 
     210    $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments ); 
     211    if ( current_user_can( 'moderate_comments' ) ) { 
    210212        $num = "<a href='edit-comments.php'>$num</a>"; 
    211     echo '<td class="b b-comments">'.$num.'</td>'; 
    212     echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>'; 
     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>'; 
    213217 
    214218    echo '</tr><tr>'; 
     
    216220    // Pages 
    217221    $num = number_format_i18n( $num_pages->publish ); 
    218     if ( current_user_can( 'edit_pages' ) ) 
     222    $text = __ngettext( 'Page', 'Pages', $num_pages->publish ); 
     223    if ( current_user_can( 'edit_pages' ) ) { 
    219224        $num = "<a href='edit-pages.php'>$num</a>"; 
    220     echo '<td class="first b b_pages">'.$num.'</td>'; 
    221     echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>'; 
     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>'; 
    222229 
    223230    // Approved Comments 
    224231    $num = number_format_i18n($num_comm->approved); 
    225     if ( current_user_can( 'moderate_comments' ) ) 
     232    $text = __ngettext( 'Approved', 'Approved', $num_comm->approved ); 
     233    if ( current_user_can( 'moderate_comments' ) ) { 
    226234        $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>"; 
    227     echo '<td class="b b_approved">'.$num.'</td>'; 
    228     echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>'; 
     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>'; 
    229239 
    230240    echo "</tr>\n\t<tr>"; 
     
    232242    // Categories 
    233243    $num = number_format_i18n( $num_cats ); 
    234     if ( current_user_can( 'manage_categories' ) ) 
     244    $text = __ngettext( 'Category', 'Categories', $num_cats ); 
     245    if ( current_user_can( 'manage_categories' ) ) { 
    235246        $num = "<a href='categories.php'>$num</a>"; 
    236     echo '<td class="first b b-cats">'.$num.'</td>'; 
    237     echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>'; 
     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>'; 
    238251 
    239252    // Pending Comments 
    240253    $num = number_format_i18n($num_comm->moderated); 
    241     if ( current_user_can( 'moderate_comments' ) ) 
     254    $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated ); 
     255    if ( current_user_can( 'moderate_comments' ) ) { 
    242256        $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>"; 
    243     echo '<td class="b b-waiting">'.$num.'</td>'; 
    244     echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>'; 
     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>'; 
    245261 
    246262    echo "</tr>\n\t<tr>"; 
     
    248264    // Tags 
    249265    $num = number_format_i18n( $num_tags ); 
    250     if ( current_user_can( 'manage_categories' ) ) 
     266    $text = __ngettext( 'Tag', 'Tags', $num_tags ); 
     267    if ( current_user_can( 'manage_categories' ) ) { 
    251268        $num = "<a href='edit-tags.php'>$num</a>"; 
    252     echo '<td class="first b b-tags">'.$num.'</td>'; 
    253     echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>'; 
     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>'; 
    254273 
    255274    // Spam Comments 
    256275    $num = number_format_i18n($num_comm->spam); 
    257     if ( current_user_can( 'moderate_comments' ) ) 
     276    $text = __ngettext( 'Spam', 'Spam', $num_comm->spam ); 
     277    if ( current_user_can( 'moderate_comments' ) ) { 
    258278        $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; 
    259     echo '<td class="b b-spam">'.$num.'</td>'; 
    260     echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>'; 
     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>'; 
    261283 
    262284    echo "</tr>"; 
     
    282304    update_right_now_message(); 
    283305 
    284     echo "\n\t".'</div>'; 
     306    echo "\n\t".'<br class="clear" /></div>'; 
    285307    do_action( 'rightnow_end' ); 
    286308    do_action( 'activity_box_end' ); 
  • tags/2.7.1/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 
    670673    if ( strpos($credentials['hostname'], ':') ) 
    671674        list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); 
     675    else 
     676        unset($credentials['port']); 
    672677 
    673678    if ( defined('FTP_SSH') || (isset($_POST['connection_type']) && 'ssh' == $_POST['connection_type']) ) 
     
    680685    if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { 
    681686        $stored_credentials = $credentials; 
    682         unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']); 
     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']); 
    683691        update_option('ftp_credentials', $stored_credentials); 
    684692        return $credentials; 
  • tags/2.7.1/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     
    372377    if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 
    373378        $post = $_post = get_post($attachment_id, ARRAY_A); 
     
    380385        if ( isset($attachment['menu_order']) ) 
    381386            $post['menu_order'] = $attachment['menu_order']; 
    382         if ( isset($attachment['post_parent']) ) 
    383             $post['post_parent'] = $attachment['post_parent']; 
     387        if ( isset($send_id) && $attachment_id == $send_id ) { 
     388            if ( isset($attachment['post_parent']) ) 
     389                $post['post_parent'] = $attachment['post_parent']; 
     390        } 
    384391 
    385392        $post = apply_filters('attachment_fields_to_save', $post, $attachment); 
     
    409416    } 
    410417 
    411     if ( isset($_POST['send']) ) { 
    412         $keys = array_keys($_POST['send']); 
    413         $send_id = (int) array_shift($keys); 
     418    if ( isset($send_id) ) { 
    414419        $attachment = stripslashes_deep( $_POST['attachments'][$send_id] ); 
    415420        $html = $attachment['post_title']; 
  • tags/2.7.1/wp-admin/includes/plugin.php

    r10539 r10539  
    122122            $plugin_data['Title'] = $plugin_data['Name']; 
    123123 
    124         if ( ! empty($plugin_data['AuthorURI']) ) 
     124        if ( ! empty($plugin_data['AuthorURI']) && ! empty($plugin_data['Author']) ) 
    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( $_wp_submenu_nopriv[$parent][$pagenow] ) ) 
     865    if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) ) 
    866866        return false; 
    867867 
  • tags/2.7.1/wp-admin/includes/post.php

    r10539 r10539  
    229229        $post_data = &$_POST; 
    230230 
    231     if ( 'page' == $post_data['post_type'] ) { 
     231    if ( isset($post_data['post_type']) && '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 
    912914    $permalink = get_permalink($post, true); 
    913915 
     
    927929    $post->post_date = $original_date; 
    928930    $post->post_name = $original_name; 
     931    unset($post->filter); 
     932 
    929933    return $permalink; 
    930934} 
     
    11621166            if ( ! empty($mce_external_languages) ) { 
    11631167                foreach ( $mce_external_languages as $name => $path ) { 
    1164                     if ( is_file($path) && is_readable($path) ) { 
     1168                    if ( @is_file($path) && @is_readable($path) ) { 
    11651169                        include_once($path); 
    1166                         $ext_plugins .= $strings; 
     1170                        $ext_plugins .= $strings . "\n"; 
    11671171                        $loaded_langs[] = $name; 
    11681172                    } 
     
    11851189                        $path = trailingslashit( realpath($path) ); 
    11861190 
    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'); 
     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"; 
    11921196 
    11931197                    if ( 'en' != $mce_locale && empty($strings) ) { 
    1194                         if ( is_file($path . 'en.js') ) { 
     1198                        if ( @is_file($path . 'en.js') ) { 
    11951199                            $str1 = @file_get_contents($path . 'en.js'); 
    1196                             $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ); 
     1200                            $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n"; 
    11971201                        } 
    11981202 
    1199                         if ( is_file($path . 'en_dlg.js') ) { 
     1203                        if ( @is_file($path . 'en_dlg.js') ) { 
    12001204                            $str2 = @file_get_contents($path . 'en_dlg.js'); 
    1201                             $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ); 
     1205                            $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n"; 
    12021206                        } 
    12031207                    } 
  • tags/2.7.1/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.1/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 ) { 
    443     $walker = new Walker_Category_Checklist; 
     442function 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 
    444446    $descendants_and_self = (int) $descendants_and_self; 
    445447 
     
    23982400 
    23992401    if ( $for_post ) 
    2400         $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 
     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; 
    24012403 
    24022404    $tab_index_attribute = ''; 
  • tags/2.7.1/wp-admin/index.php

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

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

    r10539 r10539  
    11 
    2 switchEditors = { 
     2var switchEditors = { 
    33 
    44    mode : '', 
     
    170170        return pee; 
    171171    } 
    172 } 
     172}; 
  • tags/2.7.1/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-sumbit').click( function() { newCat.focus(); } ); 
     14    jQuery('#category-add-submit').click( function() { newCat.focus(); } ); 
    1515    var noSyncChecks = false; // prophylactic. necessary? 
    1616    var syncChecks = function() { 
  • tags/2.7.1/wp-admin/js/plugin-install.js

    r10539 r10539  
    3030        return false; 
    3131    }); 
    32  
    33     $(window).resize( function() { tb_position() } ); 
    3432}); 
    3533 
  • tags/2.7.1/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 = str_replace('www.', '', $short_url); 
     171        $short_url = preg_replace('/^www./i', '', $short_url); 
    172172        if ('/' == substr($short_url, -1)) 
    173173            $short_url = substr($short_url, 0, -1); 
  • tags/2.7.1/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]}") || !empty($menu_hook)) { 
     77            if ( ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") && ('index.php' != $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]}") || ! empty($menu_hook) ) { 
     118                if ( ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") && ('index.php' != $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.1/wp-admin/menu.php

    r10539 r10539  
    8484} 
    8585 
    86 $menu[55] = array( __('Tools'), 'manage_options', 'tools.php', '', 'menu-top', 'menu-tools', 'div' ); 
     86$menu[55] = array( __('Tools'), 'read', '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.1/wp-admin/theme-editor.php

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

    r10539 r10539  
    135135    global $wp_filesystem; 
    136136 
    137     $url = wp_nonce_url('update-core.php?action=do-core-upgrade', 'upgrade-core'); 
     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'); 
    138142    if ( false === ($credentials = request_filesystem_credentials($url)) ) 
    139143        return; 
  • tags/2.7.1/wp-admin/wp-admin.css

    r10539 r10539  
    1616} 
    1717 
    18 .plugins .togl { 
    19     width: 150px; 
     18.plugins .action-links {  
     19    white-space: nowrap; 
    2020} 
    2121 
     
    436436} 
    437437 
    438 #ed_toolbar input { 
     438#ed_toolbar input, 
     439#ed_reply_toolbar input { 
    439440    margin: 3px 1px 4px; 
    440441    line-height: 18px; 
     
    449450    -webkit-border-radius: 3px; 
    450451    border-radius: 3px; 
     452} 
     453 
     454#ed_reply_toolbar input { 
     455    margin: 1px 2px 1px 1px; 
    451456} 
    452457 
     
    16441649 
    16451650#edit-slug-box { 
     1651    height: 1em; 
    16461652    margin-top: 8px; 
    16471653    padding: 0 7px; 
     
    18531859    padding: 0; 
    18541860    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 
     1873ul#category-tabs { 
     1874    margin-top: 12px; 
     1875} 
     1876 
     1877ul#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; 
    18551886} 
    18561887 
     
    22532284} 
    22542285 
    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  
    22662286/* show/hide settings */ 
    2267  
    22682287#screen-meta { 
    22692288    position: relative; 
  • tags/2.7.1/wp-config-sample.php

    r10539 r10539  
    3838 * 
    3939 * Change these to different unique phrases! 
    40  * You can generate these using the {@link http://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} 
     40 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} 
    4141 * 
    4242 * @since 2.6.0 
  • tags/2.7.1/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 1 (integer). Whether to show link name if 
     29 * 'show_name' - Default is 0 (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.1/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']) ) { 
     122        } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_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.1/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.1/wp-includes/category-template.php

    r10539 r10539  
    398398        if ( $show_option_all ) { 
    399399            $show_option_all = apply_filters( 'list_cats', $show_option_all ); 
    400             $output .= "\t<option value='0'>$show_option_all</option>\n"; 
     400            $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : ''; 
     401            $output .= "\t<option value='0'$selected>$show_option_all</option>\n"; 
    401402        } 
    402403 
    403404        if ( $show_option_none ) { 
    404405            $show_option_none = apply_filters( 'list_cats', $show_option_none ); 
    405             $output .= "\t<option value='-1'>$show_option_none</option>\n"; 
     406            $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : ''; 
     407            $output .= "\t<option value='-1'$selected>$show_option_none</option>\n"; 
    406408        } 
    407409 
     
    444446 *     'child_of' (int) default is 0 - See {@link get_categories()}. 
    445447 *     'exclude' (string) - See {@link get_categories()}. 
     448 *     'exclude_tree' (string) - See {@link get_categories()}. 
    446449 *     'echo' (bool|int) default is 1 - Whether to display or retrieve content. 
    447450 *     'current_category' (int) - See {@link get_categories()}. 
     
    462465        'hide_empty' => 1, 'use_desc_for_title' => 1, 
    463466        'child_of' => 0, 'feed' => '', 'feed_type' => '', 
    464         'feed_image' => '', 'exclude' => '', 'current_category' => 0, 
     467        'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0, 
    465468        'hierarchical' => true, 'title_li' => __( 'Categories' ), 
    466469        'echo' => 1, 'depth' => 0 
     
    475478    if ( isset( $r['show_date'] ) ) { 
    476479        $r['include_last_update_time'] = $r['show_date']; 
     480    } 
     481 
     482    if ( true == $r['hierarchical'] ) { 
     483        $r['exclude_tree'] = $r['exclude']; 
     484        $r['exclude'] = ''; 
    477485    } 
    478486 
     
    537545 * be to return the top 45 tags in the tag cloud list. 
    538546 * 
    539 * The 'topic_count_text_callback' argument is a function, which, given the count 
     547 * The 'topic_count_text_callback' argument is a function, which, given the count 
    540548 * of the posts  with that tag, returns a text for the tooltip of the tag link. 
    541  * @see default_topic_count_text 
    542549 * 
    543550 * The 'exclude' and 'include' arguments are used for the {@link get_tags()} 
     
    614621 * The 'topic_count_text_callback' argument is a function, which given the count 
    615622 * of the posts  with that tag returns a text for the tooltip of the tag link. 
    616  * @see default_topic_count_text 
    617  * 
    618623 * 
    619624 * @todo Complete functionality. 
     
    650655        uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') ); 
    651656    else 
    652         uasort( $tags, create_function('$a, $b', 'return ($a->count < $b->count);') ); 
     657        uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') ); 
    653658 
    654659    if ( 'DESC' == $order ) 
     
    721726 */ 
    722727function walk_category_tree() { 
    723     $walker = new Walker_Category; 
    724728    $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 
    725735    return call_user_func_array(array( &$walker, 'walk' ), $args ); 
    726736} 
     
    734744 */ 
    735745function walk_category_dropdown_tree() { 
    736     $walker = new Walker_CategoryDropdown; 
    737746    $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 
    738753    return call_user_func_array(array( &$walker, 'walk' ), $args ); 
    739754} 
  • tags/2.7.1/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.1/wp-includes/comment-template.php

    r10539 r10539  
    834834 
    835835    $overridden_cpage = FALSE; 
    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() ); 
     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 ); 
    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' 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' 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>"; 
    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' 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' 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>"; 
    10411041    } 
    10421042    return apply_filters('post_comments_link', $before . $link . $after, $post); 
  • tags/2.7.1/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("|(href\t*?=\t*?['\"]?)?(https?:)?//|i", apply_filters('comment_text', $comment), $out) >= get_option('comment_max_links') ) 
     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') ) 
    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_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_approved = '1' 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_single() || !get_option('close_comments_for_old_posts') ) 
     1583    if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') ) 
    15841584        return $posts; 
    15851585 
  • tags/2.7.1/wp-includes/compat.php

    r10539 r10539  
    9797} 
    9898 
     99if ( !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 
    99118?> 
  • tags/2.7.1/wp-includes/cron.php

    r10539 r10539  
    1717 * 
    1818 * @param int $timestamp Timestamp for when to run the event. 
    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. 
     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. 
    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 callback $hook Function or method to call, when cron is run. 
    47  * @param array $args Optional. Arguments to pass to the hook function. 
     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. 
    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 callback $hook Function or method to call, when cron is run. 
    69  * @param array $args Optional. Arguments to pass to the hook function. 
     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. 
    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 callback $hook Function or method to call, when cron is run. 
    104  * @param array $args Optional. Arguments to pass to the hook function. 
     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. 
    105108 */ 
    106109function wp_unschedule_event( $timestamp, $hook, $args = array() ) { 
     
    120123 * @since 2.1.0 
    121124 * 
    122  * @param callback $hook Function or method to call, when cron is run. 
     125 * @param string $hook Action hook, the execution of which will be unscheduled. 
    123126 * @param mixed $args,... Optional. Event arguments. 
    124127 */ 
     
    135138 * @since 2.1.0 
    136139 * 
    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. 
     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. 
    139142 * @return bool|int The UNIX timestamp of the next time the scheduled event will occur. 
    140143 */ 
     
    281284 * @since 2.1.0 
    282285 * 
    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. 
     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. 
    285288 * @return string|bool False, if no schedule. Schedule on success. 
    286289 */ 
  • tags/2.7.1/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" 
    1415    <?php do_action('atom_ns'); ?> 
    1516> 
     
    6465        </author> 
    6566 
    66         <id><?php comment_link(); ?></id> 
     67        <id><?php comment_guid(); ?></id> 
    6768        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> 
    6869        <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published> 
     
    7980    // 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 
    8081?> 
    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'); ?>" /> 
     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'); ?>" /> 
    8283<?php endif; 
    8384    do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); 
  • tags/2.7.1/wp-includes/feed.php

    r10539 r10539  
    224224 * @subpackage Feed 
    225225 * @since unknown 
    226  */ 
    227 function comment_guid() { 
    228     echo get_comment_guid(); 
     226 * 
     227 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. 
     228 */ 
     229function comment_guid($comment_id = null) { 
     230    echo get_comment_guid($comment_id); 
    229231} 
    230232 
     
    236238 * @since unknown 
    237239 * 
     240 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. 
    238241 * @return bool|string false on failure or guid for comment on success. 
    239242 */ 
    240 function get_comment_guid() { 
    241     global $comment; 
     243function get_comment_guid($comment_id = null) { 
     244    $comment = get_comment($comment_id); 
    242245 
    243246    if ( !is_object($comment) ) 
     
    253256 */ 
    254257function comment_link() { 
    255     echo get_comment_link(); 
     258    echo clean_url( get_comment_link() ); 
    256259} 
    257260 
  • tags/2.7.1/wp-includes/formatting.php

    r10539 r10539  
    187187 * Converts a number of special characters into their HTML entities. 
    188188 * 
    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. 
     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. 
    194193 * 
    195194 * @since 1.2.2 
    196195 * 
    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. 
     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. 
    199200 * @return string The encoded text with HTML entities. 
    200201 */ 
    201 function 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; 
     202function 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 */ 
     279function 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 */ 
     337function 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 ''; 
    217375} 
    218376 
     
    11481306    } else { 
    11491307        $subject = str_replace('_', ' ', $matches[2]); 
    1150         /** @todo use preg_replace_callback() */ 
    1151         $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject); 
     1308        $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject); 
    11521309        return $subject; 
    11531310    } 
     
    11581315 * 
    11591316 * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the 
    1160  * value of gmt_offset. 
     1317 * value of the 'gmt_offset' option. 
    11611318 * 
    11621319 * @since 1.2.0 
    11631320 * 
     1321 * @uses get_option() to retrieve the the value of 'gmt_offset'. 
    11641322 * @param string $string The date to be converted. 
    11651323 * @return string GMT version of the date provided. 
     
    17431901 */ 
    17441902function js_escape($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); 
     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 ); 
    17491908} 
    17501909 
     
    17571916 * @return string 
    17581917 */ 
    1759 function attribute_escape($text) { 
    1760     $safe_text = wp_specialchars($text, true); 
    1761     return apply_filters('attribute_escape', $safe_text, $text); 
     1918function 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 ); 
    17621922} 
    17631923 
     
    17711931 */ 
    17721932function tag_escape($tag_name) { 
    1773     $safe_tag = strtolower( preg_replace('[^a-zA-Z_:]', '', $tag_name) ); 
     1933    $safe_tag = strtolower( preg_replace('/[^a-zA-Z_:]/', '', $tag_name) ); 
    17741934    return apply_filters('tag_escape', $safe_tag, $tag_name); 
    17751935} 
  • tags/2.7.1/wp-includes/functions.php

    r10539 r10539  
    8080 * The 'timestamp' type will return the current timestamp. 
    8181 * 
    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. 
     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. 
    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 offset. Default is false. 
     88 * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false. 
    8989 * @return int|string String if $type is 'gmt', int if $type is 'timestamp'. 
    9090 */ 
     
    28052805 */ 
    28062806function is_ssl() { 
    2807     return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 
     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; 
    28082816} 
    28092817 
     
    28982906 * @return object The cloned object 
    28992907 */ 
    2900 function wp_clone($object) { 
    2901     return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object); 
     2908function 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; 
    29022914} 
    29032915 
  • tags/2.7.1/wp-includes/general-template.php

    r10539 r10539  
    15931593 
    15941594    if ( $lang = get_bloginfo('language') ) { 
    1595         if ( get_option('html_type') == 'text/html' || $doctype == 'xhtml' ) 
     1595        if ( get_option('html_type') == 'text/html' || $doctype == 'html' ) 
    15961596            $attributes[] = "lang=\"$lang\""; 
    15971597 
  • tags/2.7.1/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; 
    245248            $transports = WP_Http::_getTransport($r); 
    246249        } else { 
     
    391394     * 
    392395     * @param string $body Body content 
    393      * @return bool|string|WP_Error False if not chunked encoded. WP_Error on failure. Chunked decoded body on success. 
     396     * @return string Chunked decoded body on success or raw body on failure. 
    394397     */ 
    395398    function chunkTransferDecode($body) { 
     
    402405        //$parsedHeaders = array(); Unsupported 
    403406 
    404         $done = false; 
    405  
    406         do { 
     407        while ( true ) { 
    407408            $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); 
    408409 
    409410            if ( $hasChunk ) { 
    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                 } 
     411                if ( empty($match[1]) ) 
     412                    return $body; 
    413413 
    414414                $length = hexdec( $match[1] ); 
     
    420420                $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); 
    421421 
    422                 if( "0" == trim($body) ) { 
    423                     $done = true; 
     422                if( "0" == trim($body) ) 
    424423                    return $parsedBody; // Ignore footer headers. 
    425                     break; 
    426                 } 
    427424            } else { 
    428                 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') ); 
     425                return $body; 
    429426            } 
    430         } while ( false === $done ); 
     427        } 
    431428    } 
    432429} 
     
    645642            return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 
    646643 
    647         if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] ) 
     644        if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) 
    648645            $url = str_replace($arrURL['scheme'], 'http', $url); 
    649646 
     
    751748            return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 
    752749 
    753         if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] ) 
     750        if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) 
    754751            $url = str_replace($arrURL['scheme'], 'http', $url); 
    755752 
     
    778775        $context = stream_context_create($arrContext); 
    779776 
    780         if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) 
     777        if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) 
    781778            $handle = @fopen($url, 'r', false, $context); 
    782779        else 
     
    983980        } 
    984981 
    985         // If timeout is a float less than 1, round it up to 1. 
     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. 
    986984        if ( $r['timeout'] > 0 && $r['timeout'] < 1 ) 
    987985            $r['timeout'] = 1; 
     
    990988        curl_setopt( $handle, CURLOPT_URL, $url); 
    991989 
     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. 
    10101011        if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) 
    10111012            curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true ); 
     
    10631064     */ 
    10641065    function test() { 
    1065         if ( function_exists('curl_init') ) 
     1066        if ( function_exists('curl_init') && function_exists('curl_exec') ) 
    10661067            return true; 
    10671068 
  • tags/2.7.1/wp-includes/js/autosave.js

    r10539 r10539  
    115115 
    116116function autosave_enable_buttons() { 
    117     jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', ''); 
     117    jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr('disabled', ''); 
    118118} 
    119119 
    120120function autosave_disable_buttons() { 
    121     jQuery("#submitpost :button:enabled, #submitpost :submit:enabled").attr('disabled', 'disabled'); 
     121    jQuery(".submitbox :button:enabled, .submitbox :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.1/wp-includes/js/thickbox/thickbox.css

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

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

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

    r10539 r10539  
    395395 */ 
    396396function wp_kses_split($string, $allowed_html, $allowed_protocols) { 
    397     return preg_replace('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%e', 
    398     "wp_kses_split2('\\1', \$allowed_html, ".'$allowed_protocols)', $string); 
     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); 
    399402} 
    400403 
     
    10001003 */ 
    10011004function wp_kses_decode_entities($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); 
     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); 
    10041007 
    10051008    return $string; 
  • tags/2.7.1/wp-includes/link-template.php

    r10539 r10539  
    9393    ); 
    9494 
    95     $post = &get_post($id); 
     95    if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter ) 
     96        $post = $id; 
     97    else 
     98        $post = &get_post($id); 
    9699 
    97100    if ( empty($post->ID) ) return false; 
     
    723726    } 
    724727 
    725     $link = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>'; 
     728    $link = '<a class="post-edit-link" href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>'; 
    726729    echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; 
    727730} 
     
    773776    } 
    774777 
    775     $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 
     778    $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 
    776779    echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 
    777780} 
     
    12431246 
    12441247/** 
    1245  * Display link to next comments pages. 
    1246  * 
    1247  * @since 2.7.0 
     1248 * Return the link to next comments pages. 
     1249 * 
     1250 * @since 2.7.1 
    12481251 * 
    12491252 * @param string $label Optional. Label for link text. 
    12501253 * @param int $max_page Optional. Max page. 
    1251  */ 
    1252 function next_comments_link($label='', $max_page = 0) { 
     1254 * @return string|null 
     1255 */ 
     1256function get_next_comments_link( $label = '', $max_page = 0 ) { 
    12531257    global $wp_query; 
    12541258 
     
    12581262    $page = get_query_var('cpage'); 
    12591263 
    1260     if ( !$page ) 
    1261         $page = 1; 
    1262  
    12631264    $nextpage = intval($page) + 1; 
    12641265 
     
    12751276        $label = __('Newer Comments &raquo;'); 
    12761277 
    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. 
     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. 
    12841283 * 
    12851284 * @since 2.7.0 
    12861285 * 
     1286 * @param string $label Optional. Label for link text. 
     1287 * @param int $max_page Optional. Max page. 
     1288 */ 
     1289function 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 * 
    12871298 * @param string $label Optional. Label for comments link text. 
    1288  */ 
    1289 function previous_comments_link($label='') { 
    1290  
     1299 * @return string|null 
     1300 */ 
     1301function get_previous_comments_link( $label = '' ) { 
    12911302    if ( !is_singular() ) 
    12921303        return; 
     
    12941305    $page = get_query_var('cpage'); 
    12951306 
    1296     if ( !$page ) 
    1297         $page = 1; 
    1298  
    1299     if ( $page <= 1 ) 
     1307    if ( intval($page) <= 1 ) 
    13001308        return; 
    13011309 
     
    13051313        $label = __('&laquo; Older Comments'); 
    13061314 
    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>'; 
     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 */ 
     1325function previous_comments_link( $label = '' ) { 
     1326    echo get_previous_comments_link( $label ); 
    13101327} 
    13111328 
     
    13381355    ); 
    13391356    if ( $wp_rewrite->using_permalinks() ) 
    1340         $defaults['base'] = user_trailingslashit(get_permalink() . 'comment-page-%#%', 'commentpaged'); 
     1357        $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged'); 
    13411358 
    13421359    $args = wp_parse_args( $args, $defaults ); 
  • tags/2.7.1/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 http://api.wordpress.org/secret-key/1.0/ secret key created} for you. 
     1213 * {@link https://api.wordpress.org/secret-key/1.1/ secret key created} for you. 
    12141214 * 
    12151215 * <code> 
     
    12221222 * 
    12231223 * @since 2.5 
    1224  * @link http://api.wordpress.org/secret-key/1.0/ Create a Secret Key for wp-config.php 
     1224 * @link https://api.wordpress.org/secret-key/1.1/ 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  
    13971399 * @return string The random password 
    13981400 **/ 
     
    15281530    } 
    15291531 
     1532    if ( is_ssl() ) 
     1533        $host = 'https://secure.gravatar.com';  
     1534    else 
     1535        $host = 'http://www.gravatar.com'; 
     1536 
    15301537    if ( 'mystery' == $default ) 
    1531         $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') 
     1538        $default = "$host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') 
    15321539    elseif ( 'blank' == $default ) 
    15331540        $default = includes_url('images/blank.gif'); 
     
    15351542        $default = ''; 
    15361543    elseif ( 'gravatar_default' == $default ) 
    1537         $default = "http://www.gravatar.com/avatar/s={$size}"; 
     1544        $default = "$host/avatar/s={$size}"; 
    15381545    elseif ( empty($email) ) 
    1539         $default = "http://www.gravatar.com/avatar/?d=$default&amp;s={$size}"; 
     1546        $default = "$host/avatar/?d=$default&amp;s={$size}"; 
    15401547    elseif ( strpos($default, 'http://') === 0 ) 
    15411548        $default = add_query_arg( 's', $size, $default ); 
    15421549 
    15431550    if ( !empty($email) ) { 
    1544         $out = 'http://www.gravatar.com/avatar/'; 
     1551        $out = "$host/avatar/"; 
    15451552        $out .= md5( strtolower( $email ) ); 
    15461553        $out .= '?s='.$size; 
  • tags/2.7.1/wp-includes/post-template.php

    r10539 r10539  
    224224    } 
    225225    if ( $preview ) // preview fix for javascript bug with foreign languages 
    226         $output =   preg_replace('/\%u([0-9A-F]{4,4})/e',   "'&#'.base_convert('\\1',16,10).';'", $output); 
     226        $output =   preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[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') . '">' . $link_before . $text . $link_after . '</a></li>'; 
     683        $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['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_gmt . ' +0000' ) ); 
     1051    $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 
    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.1/wp-includes/post.php

    r10539 r10539  
    216216        else 
    217217            return $null; 
    218     } elseif ( is_object($post) ) { 
     218    } elseif ( is_object($post) && empty($post->filter) ) { 
    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; 
    223225        $post = (int) $post; 
    224226        if ( ! $_post = wp_cache_get($post, 'posts') ) { 
     
    740742    $custom = get_post_custom($post_id); 
    741743 
    742     return $custom[$key]; 
     744    return isset($custom[$key]) ? $custom[$key] : null; 
    743745} 
    744746 
     
    793795        foreach ( array_keys(get_object_vars($post)) as $field ) 
    794796            $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 
     797        $post->filter = $context; 
    795798    } else { 
    796799        if ( !isset($post['ID']) ) 
     
    798801        foreach ( array_keys($post) as $field ) 
    799802            $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 
    800     } 
     803        $post['filter'] = $context; 
     804    } 
     805 
    801806    return $post; 
    802807} 
     
    25362541            if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location 
    25372542                $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. 
    25382547        } 
    25392548    } 
  • tags/2.7.1/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-20080430'); 
     106    $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20090123'); 
    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.1/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 * 
    537541 * include - Default is an empty string.  A comma- or space-delimited string 
    538542 * of term ids to include in the return array. 
     
    605609 
    606610    $defaults = array('orderby' => 'name', 'order' => 'ASC', 
    607         'hide_empty' => true, 'exclude' => '', 'include' => '', 
     611        'hide_empty' => true, 'exclude' => '', 'exclude_tree' => '', 'include' => '', 
    608612        'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 
    609613        'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 
     
    669673    if ( !empty($include) ) { 
    670674        $exclude = ''; 
     675        $exclude_tree = ''; 
    671676        $interms = preg_split('/[\s,]+/',$include); 
    672677        if ( count($interms) ) { 
     
    685690 
    686691    $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    } 
    687706    if ( !empty($exclude) ) { 
    688707        $exterms = preg_split('/[\s,]+/',$exclude); 
    689708        if ( count($exterms) ) { 
    690709            foreach ( (array) $exterms as $exterm ) { 
    691                 if (empty($exclusions)) 
     710                if ( empty($exclusions) ) 
    692711                    $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 
    693712                else 
     
    718737        $where .= ' AND tt.count > 0'; 
    719738 
    720     if ( !empty($number) ) { 
     739    // don't limit the query results when we have to descend the family tree  
     740    if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' == $parent ) { 
    721741        if( $offset ) 
    722             $number = 'LIMIT ' . $offset . ',' . $number; 
     742            $limit = 'LIMIT ' . $offset . ',' . $number; 
    723743        else 
    724             $number = 'LIMIT ' . $number; 
     744            $limit = 'LIMIT ' . $number; 
    725745 
    726746    } else 
    727         $number = ''; 
     747        $limit = ''; 
    728748 
    729749    if ( !empty($search) ) { 
     
    740760        $select_this = 't.term_id, tt.parent, tt.count, t.name'; 
    741761 
    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  
     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); 
    744765    if ( 'all' == $fields ) { 
    745         $terms = $wpdb->get_results($query); 
    746766        update_term_cache($terms); 
    747     } else if ( ('ids' == $fields) || ('names' == $fields) ) { 
    748         $terms = $wpdb->get_results($query); 
    749767    } 
    750768 
     
    792810            $_terms[] = $term->name; 
    793811        $terms = $_terms; 
     812    } 
     813 
     814    if ( 0 < $number && intval(@count($terms)) > $number ) { 
     815        $terms = array_slice($terms, $offset, $number); 
    794816    } 
    795817 
  • tags/2.7.1/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.1/wp-includes/version.php

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

    r10539 r10539  
    549549    global $wp_registered_widgets, $wp_registered_sidebars; 
    550550 
    551     $sidebars_widgets = get_option('sidebars_widgets'); 
     551    $sidebars_widgets = get_option('sidebars_widgets', array()); 
    552552    $_sidebars_widgets = array(); 
    553553 
     
    619619    } 
    620620 
    621     unset($sidebars_widgets['array_version']); 
     621    if ( isset($sidebars_widgets['array_version']) ) 
     622        unset($sidebars_widgets['array_version']); 
    622623 
    623624    $sidebars_widgets = apply_filters('sidebars_widgets', $sidebars_widgets); 
     
    13991400            <ul id="recentcomments"><?php 
    14001401            if ( $comments ) : foreach ( (array) $comments as $comment) : 
    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>'; 
     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>'; 
    14021403            endforeach; endif;?></ul> 
    14031404        <?php echo $after_widget; ?> 
     
    20932094 
    20942095// This is important 
    2095 add_action( 'widgets_init', 'widget_many_register' ) 
     2096add_action( 'widgets_init', 'widget_many_register' ); 
    20962097 
    20972098*/ 
  • tags/2.7.1/wp-settings.php

    r10539 r10539  
    1616    @ini_set('memory_limit', WP_MEMORY_LIMIT); 
    1717 
     18set_magic_quotes_runtime(0); 
     19@ini_set('magic_quotes_sybase', 0); 
    1820 
    1921/** 
     
    200202    error_reporting(E_ALL); 
    201203} else { 
    202     error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); 
     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); 
    203211} 
    204212 
  • tags/2.7.1/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.' ) ); 
    12631261        } 
    12641262 
     
    12861284            if ( isset($content_struct['author']) ) 
    12871285                $comment['comment_author'] = $content_struct['author']; 
     1286 
    12881287            $comment['comment_author_email'] = ''; 
    1289             if ( isset($content_struct['author']) ) 
     1288            if ( isset($content_struct['author_email']) ) 
    12901289                $comment['comment_author_email'] = $content_struct['author_email']; 
     1290 
    12911291            $comment['comment_author_url'] = ''; 
    1292             if ( isset($content_struct['author']) ) 
     1292            if ( isset($content_struct['author_url']) ) 
    12931293                $comment['comment_author_url'] = $content_struct['author_url']; 
     1294 
    12941295            $comment['user_ID'] = 0; 
    12951296 
     
    27622763                $struct['categoryId'] = $cat->term_id; 
    27632764                $struct['parentId'] = $cat->parent; 
    2764                 $struct['description'] = $cat->description; 
     2765                $struct['description'] = $cat->name; 
     2766                $struct['categoryDescription'] = $cat->description; 
    27652767                $struct['categoryName'] = $cat->name; 
    27662768                $struct['htmlUrl'] = wp_specialchars(get_category_link($cat->term_id)); 
Note: See TracChangeset for help on using the changeset viewer.