Changeset 788

Show
Ignore:
Timestamp:
10/03/06 10:52:54 (2 years ago)
Author:
donncha
Message:

WP Merge to rev 4273

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r774 r788  
    19121912        $new_file = $uploads['path'] . "/$filename"; 
    19131913        if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) ) 
    1914                 wp_die(printf(__('The uploaded file could not be moved to %s.'), $file['path'])); 
     1914                wp_die(printf(__('The uploaded file could not be moved to %s.'), $uploads['path'])); 
    19151915 
    19161916        // Set correct file permissions 
  • trunk/wp-admin/edit-comments.php

    r774 r788  
    192192                } // end foreach 
    193193        ?></table> 
    194 <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php _e("Please select some comments to delete"); ?>'); return false } return confirm('<?php printf(__("You are about to delete %s comments permanently \\n  \'Cancel\' to stop, \'OK\' to delete."), "' + numchecked + '"); ?>')" /> 
     194<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php _e("Please select some comments to delete"); ?>'); return false } return confirm('<?php printf(__("You are about to delete %s comments permanently \\n  \'Cancel\' to stop, \'OK\' to delete."), "' + numchecked + '"); ?>')" /> 
    195195                        <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n  \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p> 
    196196  </form> 
  • trunk/wp-admin/edit-form-advanced.php

    r770 r788  
    253253 
    254254<?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?> 
    255 <input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 
     255<input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 
    256256<?php endif; ?> 
    257257 
  • trunk/wp-admin/edit-form-comment.php

    r729 r788  
    6767 
    6868        <tr> 
    69                 <th scope="row" valign="top"><?php _e('Delete'); ?>:</th> 
    70                 <td><input name="deletecomment" class="button" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"return confirm('" . __("You are about to delete this comment \\n  \'Cancel\' to stop, \'OK\' to delete.") . "')\""; ?> />  
     69                <th scope="row" valign="top"><?php _e('Delete'); $delete_nonce = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); ?>:</th> 
     70                <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . __("You are about to delete this comment \\n  \'Cancel\' to stop, \'OK\' to delete.") . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true; } return false;\""; ?> />  
    7171                <input type="hidden" name="comment" value="<?php echo $comment->comment_ID ?>" /> 
    7272                <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 
  • trunk/wp-admin/edit-page-form.php

    r734 r788  
    190190        $delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID );  
    191191        if ( current_user_can('delete_page', $post->ID) ) ?> 
    192                 <input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 
     192                <input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 
    193193<?php endif; ?> 
    194194</div> 
  • trunk/wp-admin/import/dotclear.php

    r734 r788  
    409409                                if($cat1 = get_catbynicename($post_cat_name)) { $cats[1] = $cat1; } 
    410410 
    411                                 if(!empty($cats)) { wp_set_post_cats('', $ret_id, $cats); } 
     411                                if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } 
    412412                        } 
    413413                } 
  • trunk/wp-admin/import/textpattern.php

    r734 r788  
    339339                                if($cat2 = get_catbynicename($Category2)) { $cats[2] = $cat2; } 
    340340 
    341                                 if(!empty($cats)) { wp_set_post_cats('', $ret_id, $cats); } 
     341                                if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } 
    342342                        } 
    343343                } 
  • trunk/wp-admin/theme-editor.php

    r729 r788  
    4646                fwrite($f, $newcontent); 
    4747                fclose($f); 
    48                 wp_redirect("theme-editor.php?file=$file&theme=$theme&a=te")
     48                $location = "theme-editor.php?file=$file&theme=$theme&a=te"
    4949        } else { 
    50                 wp_redirect("theme-editor.php?file=$file&theme=$theme")
     50                $location = "theme-editor.php?file=$file&theme=$theme"
    5151        } 
    5252 
     53        $location = wp_kses_no_null($location); 
     54        $strip = array('%0d', '%0a'); 
     55        $location = str_replace($strip, '', $location); 
     56        header("Location: $location"); 
    5357        exit(); 
    5458 
  • trunk/wp-admin/wp-admin.css

    r774 r788  
    503503} 
    504504 
    505 #deletepost:hover, #deletecomment:hover { 
     505input.delete:hover { 
    506506        background: #ce0000; 
    507507        color: #fff; 
  • trunk/wp-content/themes/default/attachment.php

    r712 r788  
    1818                                <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?> 
    1919 
    20                                 <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?> 
     20                                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> 
    2121 
    2222                                <p class="postmetadata alt"> 
  • trunk/wp-content/themes/default/page.php

    r712 r788  
    99                                <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?> 
    1010 
    11                                 <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?> 
     11                                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> 
    1212 
    1313                        </div> 
  • trunk/wp-content/themes/default/single.php

    r712 r788  
    1616                                <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?> 
    1717 
    18                                 <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?> 
     18                                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> 
    1919 
    2020                                <p class="postmetadata alt"> 
  • trunk/wp-includes/bookmark-template.php

    r771 r788  
    317317                parse_str($args, $r); 
    318318 
    319         $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => 0
     319        $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => ''
    320320                'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, 
    321321                'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', 
     
    324324        extract($r); 
    325325 
    326         // TODO: The rest of it. 
    327         // If $categorize, group links by category with the category name being the 
    328         // title of each li, otherwise just list them with title_li as the li title. 
    329         // If $categorize and $category or $category_name, list links for the given category 
    330         // with the category name as the title li.  If not $categorize, use title_li. 
    331         // When using each category's name as a title li, use before and after args for specifying 
    332         // any markup.  We don't want to hardcode h2. 
    333  
    334326        $output = ''; 
    335327 
    336328        if ( $categorize ) { 
    337                 $cats = get_categories("type=link&orderby=$category_orderby&order=$category_order&hierarchical=0"); 
     329                //Split the bookmarks into ul's for each category 
     330                $cats = get_categories("type=link&category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0"); 
     331 
    338332                foreach ( (array) $cats as $cat ) { 
    339                         $r['category'] = $cat->cat_ID; 
    340                         $bookmarks = get_bookmarks($r); 
     333                        $bookmarks = get_bookmarks("limit=$limit&category={$cat->cat_ID}&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_inivisible&show_updated=$show_updated"); 
    341334                        if ( empty($bookmarks) ) 
    342335                                continue; 
     
    345338                        $output .= "\n\t</ul>\n</li>\n"; 
    346339                } 
     340        } else { 
     341                //output one single list using title_li for the title 
     342                $bookmarks = get_bookmarks("limit=$limit&category=$category&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_inivisible&show_updated=$show_updated"); 
     343                 
     344                if ( !empty($bookmarks) ) { 
     345                        $output .= "<li id='linkuncat' class='linkcat'>$title_before$title_li$title_after\n\t<ul>\n"; 
     346                        $output .= _walk_bookmarks($bookmarks, $r); 
     347                        $output .= "\n\t</ul>\n</li>\n"; 
     348                } 
    347349        } 
    348350 
  • trunk/wp-includes/comment.php

    r761 r788  
    188188                $time_lastcomment = mysql2date('U', $lasttime); 
    189189                $time_newcomment  = mysql2date('U', $comment_date_gmt); 
    190                 if ( ($time_newcomment - $time_lastcomment) < 15 ) { 
     190                $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); 
     191                if ( $flood_die ) { 
    191192                        do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment); 
    192                         wp_die( __('Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') ); 
     193                        wp_die( __('You are posting comments too quickly.  Slow down.') ); 
    193194                } 
    194195        } 
     
    354355        $commentdata['filtered'] = true; 
    355356        return $commentdata; 
     357} 
     358 
     359function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) { 
     360        if ( $block ) // a plugin has already blocked... we'll let that decision stand 
     361                return $block; 
     362        if ( ($time_newcomment - $time_lastcomment) < 15 ) 
     363                return true; 
     364        return false; 
    356365} 
    357366 
  • trunk/wp-includes/default-filters.php

    r763 r788  
    3838 
    3939add_filter('comment_email', 'antispambot'); 
     40 
     41add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); 
    4042 
    4143add_filter('comment_url', 'clean_url'); 
  • trunk/wp-includes/feed.php

    r774 r788  
    103103                                 $link = get_option('home') . '?feed=rss2&amp;author=' . $author_id; 
    104104       } else { 
    105                                  $link = get_author_link(0, $author_id, $author_nicename); 
     105                                 $link = get_author_posts_url($author_id, $author_nicename); 
    106106                                 $link = $link . "feed/"; 
    107107       } 
  • trunk/wp-includes/pluggable.php

    r770 r788  
    273273        $location = str_replace($strip, '', $location); 
    274274 
    275         status_header($status); 
    276  
    277         if ($is_IIS) 
     275        if ( $is_IIS ) { 
    278276                header("Refresh: 0;url=$location"); 
    279         else 
     277        } else { 
     278                status_header($status); // This causes problems on IIS 
    280279                header("Location: $location"); 
     280        } 
    281281} 
    282282endif;