Changeset 900

Show
Ignore:
Timestamp:
02/26/07 14:03:58 (2 years ago)
Author:
donncha
Message:

WP Merge to rev 4950

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app.php

    r899 r900  
    1313require_once('wp-includes/post-template.php'); 
    1414 
    15 $use_querystring = 1; 
     15// Attempt to automatically detect whether to use querystring 
     16// or PATH_INFO, based on our environment: 
     17$use_querystring = $wp_version == 'MU' ? 1 : 0; 
    1618 
    1719// If using querystring, we need to put the path together manually: 
     
    557559                        $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] ); 
    558560                elseif ( empty( $slug ) ) // just make a random name 
    559                         $slug = substr( md5( uniqid( microtime() ) ), 0, 7);; 
     561                        $slug = substr( md5( uniqid( microtime() ) ), 0, 7); 
    560562                $ext = preg_replace( '|.*/([a-z]+)|', '$1', $_SERVER['CONTENT_TYPE'] ); 
    561563                $slug = "$slug.$ext"; 
  • trunk/wp-admin/edit.php

    r868 r900  
    284284if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    285285        echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>'; 
    286         echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
     286        echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
    287287        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 
    288                 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; 
    289                 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
     288                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; 
     289                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
    290290        } 
    291         echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=".$comment->comment_post_ID."&amp;c=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]"; 
    292 } // end if any comments to show 
     291        echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> "; 
     292} 
    293293?> 
    294294</p> 
  • trunk/wp-admin/users.php

    r865 r900  
    8686                                'total' => ceil($this->total_users_for_query / $this->users_per_page), 
    8787                                'current' => $this->page, 
    88                                 'prev_text' => '&laquo; Previous Page'
    89                                 'next_text' => 'Next Page &raquo;'
     88                                'prev_text' => __('&laquo; Previous Page')
     89                                'next_text' => __('Next Page &raquo;')
    9090                                'base' => 'users.php?%_%', 
    9191                                'format' => 'userspage=%#%', 
  • trunk/wp-admin/wp-admin.css

    r873 r900  
    291291        padding: 1em 1em .2em; 
    292292        margin: 0; 
     293} 
     294 
     295.commentlist li li { 
     296        border-bottom: 0px; 
     297        padding: 0; 
    293298} 
    294299 
  • trunk/wp-comments-post.php

    r784 r900  
    1919} 
    2020 
    21 $comment_author       = trim($_POST['author']); 
     21$comment_author       = trim(strip_tags($_POST['author'])); 
    2222$comment_author_email = trim($_POST['email']); 
    2323$comment_author_url   = trim($_POST['url']); 
  • trunk/wp-includes/class-pop3.php

    r13 r900  
    44    * mail_fetch/setup.php 
    55    * 
    6     * Copyright (c) 1999-2002 The SquirrelMail Project Team 
     6    * Copyright (c) 1999-2006 The SquirrelMail Project Team 
    77    * 
    88    * Copyright (c) 1999 CDI (cdi@thewebmasters.net) All Rights Reserved 
     
    1414    * pop3 class 
    1515    * 
    16     * $Id: class-pop3.php 2066 2005-01-07 01:29:49Z saxmatt
     16    * $Id: class-pop3.php 4945 2007-02-25 18:19:21Z ryan
    1717    */ 
    1818 
     
    4040    var $BANNER     = '';       //  Holds the banner returned by the 
    4141                                //  pop server - used for apop() 
    42  
    43     var $RFC1939    = TRUE;     //  Set by noop(). See rfc1939.txt 
    44                                 // 
    4542 
    4643    var $ALLOWAPOP  = FALSE;    //  Allow or disallow apop() 
     
    6057            settype($timeout,"integer"); 
    6158            $this->TIMEOUT = $timeout; 
     59            if (!ini_get('safe_mode')) 
    6260            set_time_limit($timeout); 
    6361        } 
     
    6664 
    6765    function update_timer () { 
     66        if (!ini_get('safe_mode')) 
    6867        set_time_limit($this->TIMEOUT); 
    6968        return true; 
     
    7675        // If MAILSERVER is set, override $server with it's value 
    7776 
     77        if (!isset($port) || !$port) {$port = 110;} 
    7878        if(!empty($this->MAILSERVER)) 
    7979            $server = $this->MAILSERVER; 
     
    8585        } 
    8686 
    87         $fp = fsockopen("$server", $port, $errno, $errstr); 
     87        $fp = @fsockopen("$server", $port, $errno, $errstr); 
    8888 
    8989        if(!$fp) { 
     
    106106        $this->FP = $fp; 
    107107        $this->BANNER = $this->parse_banner($reply); 
    108         $this->RFC1939 = $this->noop(); 
    109         if($this->RFC1939) { 
    110             $this->ERROR = _("POP3: premature NOOP OK, NOT an RFC 1939 Compliant server"); 
    111             $this->quit(); 
    112             return false; 
    113         } else 
    114             return true; 
    115     } 
    116  
    117     function noop () { 
    118      
    119         if(!isset($this->FP)) { 
    120             $this->ERROR = _("POP3 noop:") . ' ' . _("No connection to server"); 
    121             return false; 
    122         } else { 
    123             $cmd = "NOOP"; 
    124             $reply = $this->send_cmd( $cmd ); 
    125             return( $this->is_ok( $reply ) ); 
    126         } 
     108        return true; 
    127109    } 
    128110 
     
    159141            $reply = $this->send_cmd("PASS $pass"); 
    160142            if(!$this->is_ok($reply)) { 
    161                 $this->ERROR = _("POP3 pass:") . ' ' . _("authentication failed ") . "[$reply]"; 
     143                $this->ERROR = _("POP3 pass:") . ' ' . _("Authentication failed ") . "[$reply]"; 
    162144                $this->quit(); 
    163145                return false; 
     
    166148                $count = $this->last("count"); 
    167149                $this->COUNT = $count; 
    168                 $this->RFC1939 = $this->noop(); 
    169                 if(!$this->RFC1939) { 
    170                     $this->ERROR = _("POP3 pass:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant"); 
    171                     $this->quit(); 
    172                     return false; 
    173                 } else 
    174                     return $count; 
     150                return $count; 
    175151            } 
    176152        } 
     
    215191                    $count = $this->last("count"); 
    216192                    $this->COUNT = $count; 
    217                     $this->RFC1939 = $this->noop(); 
    218                     if(!$this->RFC1939) { 
    219                         $this->ERROR = _("POP3 apop:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant"); 
    220                         $this->quit(); 
    221                         return false; 
    222                     } else 
    223                         return $count; 
     193                    return $count; 
    224194                } 
    225195            } 
     
    331301                return false; 
    332302            } 
    333             list($junk,$num,$size) = explode(" ",$reply); 
     303            list($junk,$num,$size) = preg_split('/\s+/',$reply); 
    334304            return $size; 
    335305        } 
     
    354324                return false; 
    355325            } 
    356             list($thisMsg,$msgSize) = explode(" ",$line); 
     326            list($thisMsg,$msgSize) = preg_split('/\s+/',$line); 
    357327            settype($thisMsg,"integer"); 
    358328            if($thisMsg != $msgC) 
     
    394364        $MsgArray = array(); 
    395365 
    396         $line = fgets($fp,$buffer)
     366        $line = ""
    397367        while ( !ereg("^\.\r\n",$line)) 
    398368        { 
     369            $line = fgets($fp,$buffer); 
     370            if (preg_match("/^\s+/", $line) && $count > 0) { 
     371                $MsgArray[$count-1] .= $line; 
     372                continue; 
     373            } 
     374            if(empty($line))    { break; } 
     375 
    399376            $MsgArray[$count] = $line; 
    400377            $count++; 
    401             $line = fgets($fp,$buffer); 
    402             if(empty($line))    { break; } 
    403378        } 
    404379        return $MsgArray; 
     
    424399        } 
    425400 
    426         $Vars = explode(" ",$reply); 
     401        $Vars = preg_split('/\s+/',$reply); 
    427402        $count = $Vars[1]; 
    428403        $size = $Vars[2]; 
     
    555530                return false; 
    556531            } 
    557             list ($ok,$num,$myUidl) = explode(" ",$reply); 
     532            list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply); 
    558533            return $myUidl; 
    559534        } else { 
     
    586561                    break; 
    587562                } 
    588                 list ($msg,$msgUidl) = explode(" ",$line); 
     563                list ($msg,$msgUidl) = preg_split('/\s+/',$line); 
    589564                $msgUidl = $this->strip_clf($msgUidl); 
    590565                if($count == $msg) { 
     
    657632        { 
    658633            $digit = substr($server_text, $count, 1); 
    659             if ( false !== $digit ) { 
     634            if (!empty($digit)) { 
    660635                if( (!$outside) && ($digit != '<') && ($digit != '>') ) 
    661636                { 
  • trunk/wp-includes/comment-template.php

    r888 r900  
    291291        } 
    292292 
    293         $comments = apply_filters( 'comments_array', $comments, $post->ID ); 
     293        // keep $comments for legacy's sake (remember $table*? ;) ) 
     294        $comments = $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID ); 
     295        $wp_query->comment_count = count($wp_query->comments); 
    294296 
    295297        define('COMMENTS_TEMPLATE', true); 
  • trunk/wp-includes/feed-atom-comments.php

    r899 r900  
    99> 
    1010        <title type="text"><?php  
    11                 if (is_single() || is_page()) { 
     11                if ( is_singular() ) 
    1212                        printf(__('Comments on: %s'), get_the_title_rss()); 
    13                 } else { 
    14                         printf(__('Comments for %s'), get_bloginfo_rss('name')); 
    15                 } 
     13                elseif ( is_search() ) 
     14                        printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); 
     15                else 
     16                        printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); 
    1617        ?></title> 
    1718        <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle> 
     
    2526 
    2627<?php 
    27 $i = 0; 
    28 if (have_posts()) : 
    29         while (have_posts()) : the_post(); 
    30                 if ($i < 1) { 
    31                         $i++; 
    32                 } 
    33                  
    34                 if (is_single() || is_page()) { 
    35                         $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,  
    36                         comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,  
    37                         $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments  
    38                         LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '" . get_the_ID() . "'  
    39                         AND $wpdb->comments.comment_approved = '1' AND $wpdb->posts.post_status = 'publish'  
    40                         AND post_date_gmt < '" . gmdate("Y-m-d H:i:59") . "'  
    41                         ORDER BY comment_date_gmt ASC" ); 
    42                 } else { // if no post id passed in, we'll just use the last posts_per_rss comments. 
    43                         $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,  
    44                         comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,  
    45                         $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments  
    46                         LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE $wpdb->posts.post_status = 'publish'  
    47                         AND $wpdb->comments.comment_approved = '1' AND post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "'   
    48                         ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss') ); 
    49                 } 
    50                  
    51                 if ($comments) { 
    52                         foreach ($comments as $comment) { 
    53                                 $GLOBALS['comment'] =& $comment; 
    54                                 get_post_custom($comment->comment_post_ID); 
     28if ( have_comments() ) : while ( have_comments() ) : the_comment(); 
     29        $comment_post = get_post($comment->comment_post_ID); 
     30        get_post_custom($comment_post->ID); 
    5531?> 
    5632        <entry> 
    5733                <title><?php 
    58                         if (!(is_single() || is_page())) { 
    59                                 $title = get_the_title($comment->comment_post_ID); 
     34                        if ( !is_singular() ) { 
     35                                $title = get_the_title($comment_post->ID); 
    6036                                $title = apply_filters('the_title', $title); 
    6137                                $title = apply_filters('the_title_rss', $title); 
     
    7046                        <name><?php comment_author_rss(); ?></name> 
    7147                        <?php if (get_comment_author_url()) echo '<uri>' . get_comment_author_url() . '</uri>'; ?> 
     48 
    7249                </author> 
    7350                 
     
    7552                <updated><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> 
    7653                <published><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></published> 
    77                  
    78         <?php if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) { ?> 
     54<?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> 
    7955                <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content> 
    80        <?php } else { ?> 
     56<?php else : // post pass ?> 
    8157                <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content> 
    82         <?php } ?> 
     58<?php endif; // post pass 
     59        do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); 
     60?> 
    8361        </entry> 
    84 <?php 
    85                         } 
    86                 } 
    87                  
    88         endwhile; 
    89 endif; 
    90 ?> 
     62<?php endwhile; endif; ?> 
    9163</feed> 
  • trunk/wp-includes/feed-atom.php

    r899 r900  
    3939                <content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content> 
    4040<?php endif; ?> 
    41 <?php rss_enclosure(); ?> 
     41<?php atom_enclosure(); ?> 
    4242<?php do_action('atom_entry'); ?> 
    4343        </entry> 
  • trunk/wp-includes/feed-rss2-comments.php

    r899 r900  
    88        xmlns:content="http://purl.org/rss/1.0/modules/content/"> 
    99<channel> 
    10 <?php 
    11 $i = 0; 
    12 if (have_posts()) : 
    13   while (have_posts()) : the_post(); 
    14         if ($i < 1) { 
    15                 $i++; 
    16 ?> 
    17         <title><?php if (is_single() || is_page() ) { printf(__('Comments on: %s'), get_the_title_rss()); } else { printf(__('Comments for %s'), get_bloginfo_rss("name")); } ?></title> 
     10       <title><?php 
     11                if ( is_singular() ) 
     12                        printf(__('Comments on: %s'), get_the_title_rss()); 
     13                elseif ( is_search() ) 
     14                       printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); 
     15                else 
     16                        printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); 
     17        ?></title> 
    1818        <link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link> 
    1919        <description><?php bloginfo_rss("description") ?></description> 
     
    2222 
    2323<?php  
    24                 if (is_single() || is_page()) { 
    25                         $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,  
    26                         comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,  
    27                         $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments  
    28                         LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '" . get_the_ID() . "'  
    29                         AND $wpdb->comments.comment_approved = '1' AND $wpdb->posts.post_status = 'publish'  
    30                         AND post_date_gmt < '" . gmdate("Y-m-d H:i:59") . "'  
    31                         ORDER BY comment_date_gmt ASC" ); 
    32                 } else { // if no post id passed in, we'll just ue the last 10 comments. 
    33                         $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,  
    34                         comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,  
    35                         $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments  
    36                         LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE $wpdb->posts.post_status = 'publish'  
    37                         AND $wpdb->comments.comment_approved = '1' AND post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "'   
    38                         ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss') ); 
    39                 } 
    40         // this line is WordPress' motor, do not delete it. 
    41                 if ($comments) { 
    42                         foreach ($comments as $comment) { 
    43                                 $GLOBALS['comment'] =& $comment; 
    44                                 // Some plugins may need to know the metadata 
    45                                 // associated with this comment's post: 
    46                                 get_post_custom($comment->comment_post_ID); 
     24if ( have_comments() ) : while ( have_comments() ) : the_comment(); 
     25        $comment_post = get_post($comment->comment_post_ID); 
     26        get_post_custom($comment_post->ID); 
    4727?> 
    4828        <item> 
    49                 <title><?php if ( ! (is_single() || is_page()) ) { 
    50                         $title = get_the_title($comment->comment_post_ID); 
    51                         $title = apply_filters('the_title', $title); 
    52                         $title = apply_filters('the_title_rss', $title); 
    53                         printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); 
    54                 } else { 
    55                         printf(__('By: %s'), get_comment_author_rss()); 
    56                 } ?></title> 
     29                <title><?php 
     30                        if ( !is_singular() ) { 
     31                                $title = get_the_title($comment_post->ID); 
     32                                $title = apply_filters('the_title', $title); 
     33                                $title = apply_filters('the_title_rss', $title); 
     34                                printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); 
     35                        } else { 
     36                                printf(__('By: %s'), get_comment_author_rss()); 
     37                        } 
     38                ?></title> 
    5739                <link><?php comment_link() ?></link> 
    5840                <author><?php echo get_comment_author_rss() ?></author> 
    5941                <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate> 
    6042                <guid><?php comment_link() ?></guid> 
    61                         <?php 
    62                         if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) { 
    63                         ?> 
     43<?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> 
    6444                <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description> 
    6545                <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> 
    66                         <?php 
    67                         } else { 
    68                         ?> 
     46<?php else : // post pass ?> 
    6947                <description><?php comment_text_rss() ?></description> 
    7048                <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded> 
    71                         <?php 
    72                         } // close check for password 
    73                         do_action('commentrss2_item', $comment->comment_ID, $comment->comment_post_ID); 
    74                         ?> 
     49<?php endif; // post pass 
     50        do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID); 
     51?> 
    7552        </item> 
    76 <?php 
    77                         } 
    78                 } 
    79         } 
    80 endwhile; endif; 
    81 ?> 
     53<?php endwhile; endif; ?> 
    8254</channel> 
    8355</rss> 
  • trunk/wp-includes/feed.php

    r899 r900  
    1111} 
    1212 
     13function get_wp_title_rss($sep = '&#187;') { 
     14        $title = wp_title($sep, false); 
     15        $title = apply_filters('get_wp_title_rss', $title); 
     16        return $title; 
     17} 
    1318 
    1419function get_the_title_rss() { 
     
    9196 
    9297function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') { 
    93         $url = get_post_comments_feed_link();; 
     98        $url = get_post_comments_feed_link(); 
    9499        echo "<a href='$url'>$link_text</a>"; 
    95100} 
     
    174179                return; 
    175180 
    176         $custom_fields = get_post_custom(); 
    177         if ( is_array($custom_fields) ) { 
    178                 while ( list($key, $val) = each($custom_fields) ) {  
    179                         if ( $key == 'enclosure' ) { 
    180                                 if ( is_array($val) ) { 
    181                                         foreach ( (array) $val as $enc ) { 
    182                                                 $enclosure = split( "\n", $enc ); 
    183                                                 print "<enclosure url='".trim( htmlspecialchars($enclosure[ 0 ]) )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n"; 
    184                                         } 
    185                                 } 
     181        foreach (get_post_custom() as $key => $val) { 
     182                if ($key == 'enclosure') { 
     183                        foreach ((array)$val as $enc) { 
     184                                $enclosure = split("\n", $enc); 
     185                                echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n"); 
    186186                        } 
    187187                } 
     
    189189} 
    190190 
     191function atom_enclosure() { 
     192        global $id, $post; 
     193        if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) 
     194                return; 
     195 
     196        foreach (get_post_custom() as $key => $val) { 
     197                if ($key == 'enclosure') { 
     198                        foreach ((array)$val as $enc) { 
     199                                $enclosure = split("\n", $enc); 
     200                                echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n"); 
     201                        } 
     202                } 
     203        } 
     204} 
     205 
    191206?> 
  • trunk/wp-includes/functions.php

    r899 r900  
    963963 
    964964        if ( $feed == '' || $feed == 'feed' ) 
    965         $feed = 'rss2'; 
    966          
    967         $for_comments = false; 
    968  
    969         if ( is_singular() || get_query_var('withcomments') == 1 ) 
    970                 $for_comments = true; 
    971  
    972          if ( false !== strpos($feed, 'comments-') ) { 
    973                 $for_comments = true; 
    974                 $feed = str_replace('comments-', '', $feed); 
    975          } 
    976  
    977          if ( get_query_var('withoutcomments') == 1 ) 
    978                 $for_comments = false; 
     965                $feed = 'rss2'; 
    979966 
    980967        $hook = 'do_feed_' . $feed; 
    981         do_action($hook, $for_comments); 
     968        do_action($hook, $wp_query->is_comment_feed); 
    982969} 
    983970 
  • trunk/wp-includes/js/tinymce/plugins/wordpress/langs/en.js

    r550 r900  
    3030numlist_desc : 'Ordered list (' + metaKey + '+o)', 
    3131outdent_desc : 'Outdent (' + metaKey + '+w)', 
    32 indent_desc : 'Indent List/Blockquote (' + metaKey + '+q)' 
     32indent_desc : 'Indent list/blockquote (' + metaKey + '+q)' 
    3333}); 
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r899 r900  
    7575        remove_linebreaks : false, 
    7676        fix_list_elements : true, 
     77        gecko_spellcheck : true, 
    7778        entities : "38,amp,60,lt,62,gt", 
    7879        content_css : "<?php echo $mce_css; ?>", 
  • trunk/wp-includes/pluggable.php

    r888 r900  
    163163if ( !function_exists('wp_mail') ) : 
    164164function wp_mail($to, $subject, $message, $headers = '') { 
    165         if( $headers == '' ) { 
     165        global $phpmailer; 
     166 
     167        if ( !is_object( $phpmailer ) ) { 
     168                require_once(ABSPATH . WPINC . '/class-phpmailer.php'); 
     169                require_once(ABSPATH . WPINC . '/class-smtp.php'); 
     170                $phpmailer = new PHPMailer(); 
     171        } 
     172                 
     173        $mail = compact('to', 'subject', 'message', 'headers'); 
     174        $mail = apply_filters('wp_mail', $mail); 
     175        extract($mail); 
     176 
     177        if ( $headers == '' ) { 
    166178                $headers = "MIME-Version: 1.0\n" . 
    167179                        "From: " . get_option('admin_email') . "\n" .  
     
    169181        } 
    170182 
    171         return @mail($to, $subject, $message, $headers); 
     183        $phpmailer->ClearAddresses(); 
     184        $phpmailer->ClearCCs(); 
     185        $phpmailer->ClearBCCs(); 
     186        $phpmailer->ClearReplyTos(); 
     187        $phpmailer->ClearAllRecipients(); 
     188        $phpmailer->ClearCustomHeaders(); 
     189 
     190        $phpmailer->FromName = "WordPress"; 
     191        $phpmailer->AddAddress("$to", ""); 
     192        $phpmailer->Subject = $subject; 
     193        $phpmailer->Body    = $message; 
     194        $phpmailer->IsHTML(false); 
     195        $phpmailer->IsMail(); // set mailer to use php mail() 
     196 
     197        do_action_ref_array('phpmailer_init', array(&$phpmailer)); 
     198 
     199        $mailheaders = (array) explode( "\n", $headers ); 
     200        foreach ( $mailheaders as $line ) { 
     201                $header = explode( ":", $line ); 
     202                switch ( trim( $header[0] ) ) { 
     203                        case "From": 
     204                                $from = trim( str_replace( '"', '', $header[1] ) ); 
     205                                if ( strpos( $from, '<' ) ) { 
     206                                        $phpmailer->FromName = str_replace( '"', '', substr( $header[1], 0, strpos( $header[1], '<' ) - 1 ) ); 
     207                                        $from = trim( substr( $from, strpos( $from, '<' ) + 1 ) ); 
     208                                        $from = str_replace( '>', '', $from ); 
     209                                } else { 
     210                                        $phpmailer->FromName = $from; 
     211                                } 
     212                                $phpmailer->From = trim( $from ); 
     213                                break; 
     214                        default: 
     215                                if ( $line != '' && $header[0] != 'MIME-Version' && $header[0] != 'Content-Type' ) 
     216                                        $phpmailer->AddCustomHeader( $line ); 
     217                                break; 
     218                } 
     219        } 
     220 
     221        $result = @$phpmailer->Send(); 
     222 
     223        return $result; 
    172224} 
    173225endif; 
     
    223275                         (empty($_COOKIE[USER_COOKIE])) ) { 
    224276                nocache_headers(); 
    225  
    226277                wp_clearcookie(); 
    227278 
  • trunk/wp-includes/query.php

    r896 r900  
    99 
    1010        return $wp_query->get($var); 
     11} 
     12 
     13function set_query_var($var, $value) { 
     14        global $wp_query; 
     15 
     16        return $wp_query->set($var, $value); 
    1117} 
    1218 
     
    249255        $wp_query->the_post(); 
    250256} 
     257 
     258/* 
     259 * Comments loop.  
     260 */  
     261 
     262function have_comments() {  
     263        global $wp_query;  
     264        return $wp_query->have_comments();  
     265}  
     266 
     267function the_comment() {  
     268        global $wp_query;  
     269        return $wp_query->the_comment();  
     270 
    251271 
    252272/* 
     
    266286        var $in_the_loop = false; 
    267287        var $post; 
     288         
     289        var $comments; 
     290        var $comment_count = 0; 
     291        var $current_comment = -1; 
     292        var $comment; 
    268293 
    269294        var $found_posts = 0; 
     
    283308        var $is_search = false; 
    284309        var $is_feed = false; 
     310        var $is_comment_feed = false; 
    285311        var $is_trackback = false; 
    286312        var $is_home = false; 
     
    306332                $this->is_search = false; 
    307333                $this->is_feed = false; 
     334                $this->is_comment_feed = false; 
    308335                $this->is_trackback = false; 
    309336                $this->is_home = false; 
     
    538565                        $this->is_singular = true; 
    539566 
     567                if ( false !== strpos($qv['feed'], 'comments-') ) { 
     568                        $this->query_vars['feed'] = $qv['feed'] = str_replace('comments-', '', $qv['feed']); 
     569                        $qv['withcomments'] = 1; 
     570                } 
     571 
     572                if ( $this->is_feed && (!empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) ) 
     573                        $this->is_comment_feed = true; 
     574 
    540575                if ( ! ($this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup)) { 
    541576                        $this->is_home = true; 
     
    932967                        if ( is_user_logged_in() ) { 
    933968                                if ( 'post' == $post_type ) 
    934                                         $cap = 'edit_private_posts'; 
     969                                        $cap = 'read_private_posts'; 
    935970                                else 
    936                                         $cap = 'edit_private_pages'; 
     971                                        $cap = 'read_private_pages'; 
    937972 
    938973                                if ( current_user_can($cap) ) 
     
    9661001                                $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; 
    9671002                        } 
     1003                } 
     1004                 
     1005                // Comments feeds 
     1006                if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search || !$this->is_singular ) ) { 
     1007                        if ( $this->is_archive || $this->is_search ) { 
     1008                                $cjoin = "LEFT JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) $join "; 
     1009                                $cwhere = "WHERE comment_approved = '1' $where"; 
     1010                                $cgroupby = "GROUP BY $wpdb->comments.comment_id"; 
     1011                        } else { // Other non singular e.g. front 
     1012                                $cjoin = "LEFT JOIN $wpdb->posts ON ( $wpdb->comments.comment_post_ID = $wpdb->posts.ID )"; 
     1013                                $cwhere = "WHERE post_status = 'publish' AND comment_approved = '1'"; 
     1014                                $cgroupby = ''; 
     1015                        } 
     1016                         
     1017                        $cjoin = apply_filters('comment_feed_join', $cjoin); 
     1018                        $cwhere = apply_filters('comment_feed_where', $cwhere); 
     1019                        $cgroupby = apply_filters('comment_feed_groupby', $cgroupby); 
     1020                         
     1021                        $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_settings('posts_per_rss')); 
     1022                        $this->comment_count = count($this->comments); 
     1023 
     1024                        $post_ids = array(); 
     1025                         
     1026                        foreach ($this->comments as $comment) 
     1027                                $post_ids[] = (int) $comment->comment_post_ID; 
     1028                         
     1029                        $post_ids = join(',', $post_ids); 
     1030                        $join = ''; 
     1031                        if ( $post_ids ) 
     1032                                $where = "AND $wpdb->posts.ID IN ($post_ids) "; 
     1033                        else 
     1034                                $where = "AND 0"; 
    9681035                } 
    9691036 
     
    9871054 
    9881055                $this->posts = $wpdb->get_results($this->request); 
     1056 
     1057                if ( $this->is_com