summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-10-03 10:52:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-10-03 10:52:54 +0000
commit23c0a299ada091cdeece968ad5cd3bdd20f5ef3c (patch)
tree9bdf04e7880e6188eca43a3bd161320568f205e4
parent081300d1c11041e8b678f9cb0736468aa11e94f1 (diff)
downloadwordpress-mu-23c0a299ada091cdeece968ad5cd3bdd20f5ef3c.tar.gz
wordpress-mu-23c0a299ada091cdeece968ad5cd3bdd20f5ef3c.tar.xz
wordpress-mu-23c0a299ada091cdeece968ad5cd3bdd20f5ef3c.zip
WP Merge to rev 4273
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@788 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/admin-functions.php2
-rw-r--r--wp-admin/edit-comments.php2
-rw-r--r--wp-admin/edit-form-advanced.php2
-rw-r--r--wp-admin/edit-form-comment.php4
-rw-r--r--wp-admin/edit-page-form.php2
-rw-r--r--wp-admin/import/dotclear.php2
-rw-r--r--wp-admin/import/textpattern.php2
-rw-r--r--wp-admin/theme-editor.php8
-rw-r--r--wp-admin/wp-admin.css2
-rw-r--r--wp-content/themes/default/attachment.php2
-rw-r--r--wp-content/themes/default/page.php2
-rw-r--r--wp-content/themes/default/single.php2
-rw-r--r--wp-includes/bookmark-template.php26
-rw-r--r--wp-includes/comment.php13
-rw-r--r--wp-includes/default-filters.php2
-rw-r--r--wp-includes/feed.php2
-rw-r--r--wp-includes/pluggable.php8
17 files changed, 50 insertions, 33 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 5dd0794..5c220a5 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -1911,7 +1911,7 @@ function wp_handle_upload(&$file, $overrides = false) {
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) )
- wp_die(printf(__('The uploaded file could not be moved to %s.'), $file['path']));
+ wp_die(printf(__('The uploaded file could not be moved to %s.'), $uploads['path']));
// Set correct file permissions
$stat = stat(dirname($new_file));
diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php
index eb3c102..ae23c63 100644
--- a/wp-admin/edit-comments.php
+++ b/wp-admin/edit-comments.php
@@ -191,7 +191,7 @@ $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
<?php
} // end foreach
?></table>
-<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 + '"); ?>')" />
+<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 + '"); ?>')" />
<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>
</form>
<div id="ajax-response"></div>
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index 7f9a97a..3ae45b9 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -252,7 +252,7 @@ list_meta($metadata);
</div>
<?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?>
-<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;\""; ?> />
+<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;\""; ?> />
<?php endif; ?>
</div>
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php
index bbcac0b..e90e059 100644
--- a/wp-admin/edit-form-comment.php
+++ b/wp-admin/edit-form-comment.php
@@ -66,8 +66,8 @@ addLoadEvent(focusit);
<?php endif; ?>
<tr>
- <th scope="row" valign="top"><?php _e('Delete'); ?>:</th>
- <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.") . "')\""; ?> />
+ <th scope="row" valign="top"><?php _e('Delete'); $delete_nonce = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); ?>:</th>
+ <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;\""; ?> />
<input type="hidden" name="comment" value="<?php echo $comment->comment_ID ?>" />
<input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" />
<input type="hidden" name="noredir" value="1" />
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php
index d68e71b..d7216a3 100644
--- a/wp-admin/edit-page-form.php
+++ b/wp-admin/edit-page-form.php
@@ -189,7 +189,7 @@ list_meta($metadata);
<?php if ('edit' == $action) :
$delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID );
if ( current_user_can('delete_page', $post->ID) ) ?>
- <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;\""; ?> />
+ <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;\""; ?> />
<?php endif; ?>
</div>
diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php
index ba988f6..48db721 100644
--- a/wp-admin/import/dotclear.php
+++ b/wp-admin/import/dotclear.php
@@ -408,7 +408,7 @@ class Dotclear_Import {
$cats = array();
if($cat1 = get_catbynicename($post_cat_name)) { $cats[1] = $cat1; }
- if(!empty($cats)) { wp_set_post_cats('', $ret_id, $cats); }
+ if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
}
}
// Store ID translation for later use
diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php
index 6af31aa..f9937ff 100644
--- a/wp-admin/import/textpattern.php
+++ b/wp-admin/import/textpattern.php
@@ -338,7 +338,7 @@ class Textpattern_Import {
if($cat1 = get_catbynicename($Category1)) { $cats[1] = $cat1; }
if($cat2 = get_catbynicename($Category2)) { $cats[2] = $cat2; }
- if(!empty($cats)) { wp_set_post_cats('', $ret_id, $cats); }
+ if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
}
}
// Store ID translation for later use
diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php
index 037cc91..7832b91 100644
--- a/wp-admin/theme-editor.php
+++ b/wp-admin/theme-editor.php
@@ -45,11 +45,15 @@ case 'update':
$f = fopen($real_file, 'w+');
fwrite($f, $newcontent);
fclose($f);
- wp_redirect("theme-editor.php?file=$file&theme=$theme&a=te");
+ $location = "theme-editor.php?file=$file&theme=$theme&a=te";
} else {
- wp_redirect("theme-editor.php?file=$file&theme=$theme");
+ $location = "theme-editor.php?file=$file&theme=$theme";
}
+ $location = wp_kses_no_null($location);
+ $strip = array('%0d', '%0a');
+ $location = str_replace($strip, '', $location);
+ header("Location: $location");
exit();
break;
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index fb19af1..a4420cc 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -502,7 +502,7 @@ table .vers {
width: 300px;
}
-#deletepost:hover, #deletecomment:hover {
+input.delete:hover {
background: #ce0000;
color: #fff;
}
diff --git a/wp-content/themes/default/attachment.php b/wp-content/themes/default/attachment.php
index 0d606db..7839b6c 100644
--- a/wp-content/themes/default/attachment.php
+++ b/wp-content/themes/default/attachment.php
@@ -17,7 +17,7 @@
<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
- <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
+ <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<p class="postmetadata alt">
<small>
diff --git a/wp-content/themes/default/page.php b/wp-content/themes/default/page.php
index 57017b0..9c3838d 100644
--- a/wp-content/themes/default/page.php
+++ b/wp-content/themes/default/page.php
@@ -8,7 +8,7 @@
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
- <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
+ <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
</div>
</div>
diff --git a/wp-content/themes/default/single.php b/wp-content/themes/default/single.php
index fb071b1..ee040d5 100644
--- a/wp-content/themes/default/single.php
+++ b/wp-content/themes/default/single.php
@@ -15,7 +15,7 @@
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
- <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
+ <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<p class="postmetadata alt">
<small>
diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php
index d2d8560..446ea46 100644
--- a/wp-includes/bookmark-template.php
+++ b/wp-includes/bookmark-template.php
@@ -316,34 +316,36 @@ function wp_list_bookmarks($args = '') {
else
parse_str($args, $r);
- $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => 0,
+ $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '',
'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1,
'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>',
'category_orderby' => 'name', 'category_order' => 'ASC');
$r = array_merge($defaults, $r);
extract($r);
- // TODO: The rest of it.
- // If $categorize, group links by category with the category name being the
- // title of each li, otherwise just list them with title_li as the li title.
- // If $categorize and $category or $category_name, list links for the given category
- // with the category name as the title li. If not $categorize, use title_li.
- // When using each category's name as a title li, use before and after args for specifying
- // any markup. We don't want to hardcode h2.
-
$output = '';
if ( $categorize ) {
- $cats = get_categories("type=link&orderby=$category_orderby&order=$category_order&hierarchical=0");
+ //Split the bookmarks into ul's for each category
+ $cats = get_categories("type=link&category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0");
+
foreach ( (array) $cats as $cat ) {
- $r['category'] = $cat->cat_ID;
- $bookmarks = get_bookmarks($r);
+ $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");
if ( empty($bookmarks) )
continue;
$output .= "<li id='linkcat-$cat->cat_ID' class='linkcat'>$title_before$cat->cat_name$title_after\n\t<ul>\n";
$output .= _walk_bookmarks($bookmarks, $r);
$output .= "\n\t</ul>\n</li>\n";
}
+ } else {
+ //output one single list using title_li for the title
+ $bookmarks = get_bookmarks("limit=$limit&category=$category&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_inivisible&show_updated=$show_updated");
+
+ if ( !empty($bookmarks) ) {
+ $output .= "<li id='linkuncat' class='linkcat'>$title_before$title_li$title_after\n\t<ul>\n";
+ $output .= _walk_bookmarks($bookmarks, $r);
+ $output .= "\n\t</ul>\n</li>\n";
+ }
}
if ( !$echo )
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 3189b14..6ffcfcc 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -187,9 +187,10 @@ function wp_allow_comment($commentdata) {
if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$comment_author_IP' OR comment_author_email = '$comment_author_email' ORDER BY comment_date DESC LIMIT 1") ) {
$time_lastcomment = mysql2date('U', $lasttime);
$time_newcomment = mysql2date('U', $comment_date_gmt);
- if ( ($time_newcomment - $time_lastcomment) < 15 ) {
+ $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment);
+ if ( $flood_die ) {
do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment);
- wp_die( __('Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') );
+ wp_die( __('You are posting comments too quickly. Slow down.') );
}
}
@@ -355,6 +356,14 @@ function wp_filter_comment($commentdata) {
return $commentdata;
}
+function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) {
+ if ( $block ) // a plugin has already blocked... we'll let that decision stand
+ return $block;
+ if ( ($time_newcomment - $time_lastcomment) < 15 )
+ return true;
+ return false;
+}
+
function wp_new_comment( $commentdata ) {
$commentdata = apply_filters('preprocess_comment', $commentdata);
diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index 75f24ed..ad60242 100644
--- a/wp-includes/default-filters.php
+++ b/wp-includes/default-filters.php
@@ -38,6 +38,8 @@ add_filter('comment_author', 'wp_specialchars');
add_filter('comment_email', 'antispambot');
+add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3);
+
add_filter('comment_url', 'clean_url');
add_filter('comment_text', 'convert_chars');
diff --git a/wp-includes/feed.php b/wp-includes/feed.php
index 421710d..7c3ce30 100644
--- a/wp-includes/feed.php
+++ b/wp-includes/feed.php
@@ -102,7 +102,7 @@ function get_author_rss_link($echo = false, $author_id, $author_nicename) {
if ('' == $permalink_structure) {
$link = get_option('home') . '?feed=rss2&amp;author=' . $author_id;
} else {
- $link = get_author_link(0, $author_id, $author_nicename);
+ $link = get_author_posts_url($author_id, $author_nicename);
$link = $link . "feed/";
}
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 0c33ad7..71e28fa 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -272,12 +272,12 @@ function wp_redirect($location, $status = 302) {
$strip = array('%0d', '%0a');
$location = str_replace($strip, '', $location);
- status_header($status);
-
- if ($is_IIS)
+ if ( $is_IIS ) {
header("Refresh: 0;url=$location");
- else
+ } else {
+ status_header($status); // This causes problems on IIS
header("Location: $location");
+ }
}
endif;