summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-10 14:08:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-10 14:08:54 +0000
commit310940b824eff4a116dcd72ccd339bb602021981 (patch)
tree19f6efc7b30b9456eebc26d578c5dc7e125bb6e7
parent616f7399dc4c4f7c56951c7b87a7aa91b3e690a3 (diff)
downloadwordpress-mu-310940b824eff4a116dcd72ccd339bb602021981.tar.gz
wordpress-mu-310940b824eff4a116dcd72ccd339bb602021981.tar.xz
wordpress-mu-310940b824eff4a116dcd72ccd339bb602021981.zip
Merge with branches/2.5 in WordPress, revision 8066
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1324 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/async-upload.php4
-rw-r--r--wp-admin/comment.php4
-rw-r--r--wp-admin/css/media.css20
-rw-r--r--wp-admin/css/widgets-rtl.css9
-rw-r--r--wp-admin/css/widgets.css28
-rw-r--r--wp-admin/edit-comments.php2
-rw-r--r--wp-admin/includes/dashboard.php4
-rw-r--r--wp-admin/includes/media.php13
-rw-r--r--wp-admin/includes/upgrade.php9
-rw-r--r--wp-admin/includes/widgets.php3
-rw-r--r--wp-admin/js/link.js3
-rw-r--r--wp-admin/js/media-upload.js35
-rw-r--r--wp-admin/js/widgets.js8
-rw-r--r--wp-admin/media.php2
-rw-r--r--wp-admin/menu.php2
-rw-r--r--wp-admin/plugins.php4
-rw-r--r--wp-admin/update.php2
-rw-r--r--wp-admin/user-edit.php2
-rw-r--r--wp-admin/widgets.php2
-rw-r--r--wp-content/themes/classic/index.php2
-rw-r--r--wp-includes/comment.php5
-rw-r--r--wp-includes/functions.php2
-rw-r--r--wp-includes/general-template.php12
-rw-r--r--wp-includes/js/swfupload/handlers.js2
-rw-r--r--wp-includes/js/thickbox/thickbox.css9
-rw-r--r--wp-includes/link-template.php4
-rw-r--r--wp-includes/media.php26
-rw-r--r--wp-includes/post.php54
-rw-r--r--wp-includes/rewrite.php12
-rw-r--r--wp-includes/script-loader.php10
-rw-r--r--wp-includes/taxonomy.php10
-rw-r--r--wp-includes/version.php6
-rw-r--r--wp-includes/widgets.php5
33 files changed, 212 insertions, 103 deletions
diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php
index 1a37dce..c1c0f0d 100644
--- a/wp-admin/async-upload.php
+++ b/wp-admin/async-upload.php
@@ -15,7 +15,7 @@ if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
unset($current_user);
require_once('admin.php');
-header('Content-Type: text/plain');
+header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
if ( !current_user_can('upload_files') )
wp_die(__('You do not have permission to upload files.'));
@@ -26,6 +26,8 @@ if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
exit;
}
+check_admin_referer('media-form');
+
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
if (is_wp_error($id)) {
echo '<div id="media-upload-error">'.wp_specialchars($id->get_error_message()).'</div>';
diff --git a/wp-admin/comment.php b/wp-admin/comment.php
index 6691456..4aa9749 100644
--- a/wp-admin/comment.php
+++ b/wp-admin/comment.php
@@ -193,10 +193,6 @@ case 'approvecomment' :
wp_set_comment_status( $comment->comment_ID, 'approve' );
- if ( true == get_option('comments_notify') )
- wp_notify_postauthor( $comment->comment_ID );
-
-
if ( '' != wp_get_referer() && false == $noredir )
wp_redirect( wp_get_referer() );
else
diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css
index c77a069..7d46c1c 100644
--- a/wp-admin/css/media.css
+++ b/wp-admin/css/media.css
@@ -196,6 +196,11 @@ abbr.required {
#media-upload .media-upload-form p {
margin: 0 1em 1em 0;
}
+
+#media-upload .media-upload-form p.ml-submit {
+ padding: 1em 0;
+}
+
#media-upload p.help {
font-style: italic;
font-weight: normal;
@@ -240,3 +245,18 @@ abbr.required {
margin-bottom: 1em;
height: 3em;
}
+
+#media-upload #filter {
+ width: 623px;
+}
+
+#media-upload #filter .subsubsub {
+ margin: 8px 0;
+}
+
+#filter .tablenav select {
+ border-style:solid;
+ border-width:1px;
+ padding:2px;
+ vertical-align:top;
+}
diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css
index 89ff4b6..ece02b5 100644
--- a/wp-admin/css/widgets-rtl.css
+++ b/wp-admin/css/widgets-rtl.css
@@ -38,13 +38,12 @@ li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-contro
left:1em;
}
-li.widget-list-control-item div.widget-control {
- padding:0 0 0 10px;
-}
ul.widget-control-list div.widget-control-actions {
margin-right:0;
margin-left:-10px;
}
-ul.widget-control-list .widget-title {
- text-align:right;
+ul.widget-control-list h4.widget-title,
+#dragHelper h4.widget-title {
+ text-align: right;
+ padding: 0.4em 0.8em 0.4em 2.5em;
}
diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css
index 5d044cf..baeb851 100644
--- a/wp-admin/css/widgets.css
+++ b/wp-admin/css/widgets.css
@@ -74,7 +74,6 @@ ul#widget-list li.widget-list-item div.widget-description {
font-size: 11px;
}
-
ul#widget-list li.widget-list-item ul.widget-control-info {
display: none;
}
@@ -91,27 +90,26 @@ ul.widget-control-list {
padding: 0 1em;
}
-ul.widget-control-list li {
- position: relative;
-}
-
div#current-widgets p.submit {
padding: 1em;
}
li.widget-list-control-item {
- margin: 0 0 1em;
+ margin: 1em 0;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
-li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 {
+li.widget-list-control-item h4,
+#dragHelper li.widget-list-control-item h4,
+li.widget-sortable h4 {
margin: 0;
- padding: 0.4em 2.5em 0.4em 0.8em;
cursor: move;
font-size: 13px;
+ padding: 0.4em 2.5em 0.4em 0.8em;
+ position: relative;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
@@ -143,16 +141,16 @@ li.widget-list-control-item h4.widget-title a,
}
li.widget-list-control-item h4.widget-title a:hover {
-
text-decoration: none;
border-bottom: none;
}
li.widget-list-control-item div.widget-control {
display: none;
- margin: 1em;
- padding: 0 10px 0 7px; /* Correction for padding, margin, border of inputs */
+ padding: 15px;
font-size: 11px;
+ position: relative;
+ background-color: #CFEBF7;
}
li.widget-list-control-item div.widget-control p {
@@ -161,15 +159,9 @@ li.widget-list-control-item div.widget-control p {
}
ul.widget-control-list div.widget-control-actions {
- margin-right: -10px; /* Correction for padding, margin, border of inputs */
- margin-left: -6px;
border-top-width: 1px;
border-top-style: solid;
- padding: 0.5em 0 0.8em;
-}
-
-ul.widget-control-list .widget-title {
-
+ padding: 0.5em 0 0;
}
.widget-control-edit {
diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php
index bc62681..c756efe 100644
--- a/wp-admin/edit-comments.php
+++ b/wp-admin/edit-comments.php
@@ -97,7 +97,7 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
<?php
$status_links = array();
$num_comments = wp_count_comments();
-$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', $num_comments->moderated), "<span class='comment-count'>$num_comments->moderated</span>"), 'approved' => _c('Approved|plural'));
+$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural'));
$class = ( '' === $comment_status ) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
foreach ( $stati as $status => $label ) {
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index ea88ee4..97fd26a 100644
--- a/wp-admin/includes/dashboard.php
+++ b/wp-admin/includes/dashboard.php
@@ -23,7 +23,9 @@ function wp_dashboard_setup() {
/* Register Widgets and Controls */
// Recent Comments Widget
- if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) {
+ $mod_comments = wp_count_comments();
+ $mod_comments = $mod_comments->moderated;
+ if ( current_user_can( 'moderate_comments' ) && $mod_comments ) {
$notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments );
$notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>";
} else {
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index be70d92..0fb84bb 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -55,7 +55,7 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
$rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : '';
if ( $url )
- $html = "<a href='".attribute_escape($url)."'$rel>$html</a>";
+ $html = '<a href="' . clean_url($url) . "\"$rel>$html</a>";
$html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );
@@ -180,7 +180,7 @@ add_action( 'media_buttons', 'media_buttons' );
function media_buttons_head() {
$siteurl = get_option('siteurl');
echo "<style type='text/css' media='all'>
- @import '{$siteurl}/wp-includes/js/thickbox/thickbox.css?1';
+ @import '{$siteurl}/wp-includes/js/thickbox/thickbox.css?ver=20080430';
div#TB_title {
background-color: #222222;
color: #cfcfcf;
@@ -188,6 +188,9 @@ echo "<style type='text/css' media='all'>
div#TB_title a, div#TB_title a:visited {
color: #cfcfcf;
}
+ #TB_window {
+ top: 20px;
+ }
</style>\n";
}
@@ -791,6 +794,7 @@ jQuery(function($){
post_params : {
"post_id" : "<?php echo $post_id; ?>",
"auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>",
+ "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
"type" : "<?php echo $type; ?>",
"tab" : "<?php echo $tab; ?>",
"short" : "1"
@@ -815,6 +819,7 @@ jQuery(function($){
//-->
</script>
+
<div id="flash-upload-ui">
<?php do_action('pre-flash-upload-ui'); ?>
<p><input id="flash-browse-button" type="button" value="<?php echo attribute_escape( __( 'Choose files to upload' ) ); ?>" class="button" /></p>
@@ -959,7 +964,6 @@ function media_upload_library_form($errors) {
<input type="submit" value="<?php echo attribute_escape( __( 'Search Media' ) ); ?>" class="button" />
</div>
-<p>
<ul class="subsubsub">
<?php
$type_links = array();
@@ -991,7 +995,6 @@ echo implode(' | </li>', $type_links) . '</li>';
unset($type_links);
?>
</ul>
-</p>
<div class="tablenav">
@@ -1066,8 +1069,10 @@ jQuery(function($){
<div id="media-items">
<?php echo get_media_items(null, $errors); ?>
</div>
+<p class="ml-submit">
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
+</p>
</form>
<?php
}
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index 94bdbd3..800a86d 100644
--- a/wp-admin/includes/upgrade.php
+++ b/wp-admin/includes/upgrade.php
@@ -205,6 +205,9 @@ function upgrade_all() {
if ( $wp_current_db_version < 7796 )
upgrade_251();
+ if ( $wp_current_db_version < 7935 )
+ upgrade_252();
+
maybe_disable_automattic_widgets();
$wp_rewrite->flush_rules();
@@ -747,6 +750,12 @@ function upgrade_251() {
update_option('secret', wp_generate_password(64));
}
+function upgrade_252() {
+ global $wpdb;
+
+ $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''");
+}
+
// The functions we use to actually do stuff
// General
diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php
index 641f80f..09936b7 100644
--- a/wp-admin/includes/widgets.php
+++ b/wp-admin/includes/widgets.php
@@ -227,6 +227,7 @@ function wp_widget_control( $sidebar_args ) {
if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
echo $sidebar_args['before_widget'];
?>
+ <div class="widget-top">
<h4 class="widget-title"><?php echo $widget_title ?>
<?php if ( $edit ) : ?>
@@ -239,7 +240,7 @@ function wp_widget_control( $sidebar_args ) {
<?php endif; ?>
- </h4>
+ </h4></div>
<div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>>
diff --git a/wp-admin/js/link.js b/wp-admin/js/link.js
index cfc0f94..2b3fa65 100644
--- a/wp-admin/js/link.js
+++ b/wp-admin/js/link.js
@@ -1,4 +1,7 @@
jQuery(document).ready( function() {
+ // close postboxes that should be closed
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
+
jQuery('#link_name').focus();
// postboxes
add_postbox_toggles('link');
diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js
index b8c615d..506faf8 100644
--- a/wp-admin/js/media-upload.js
+++ b/wp-admin/js/media-upload.js
@@ -1,12 +1,39 @@
// send html to the post editor
function send_to_editor(h) {
- var win = window.opener ? window.opener : window.dialogArguments;
- if ( !win )
- win = top;
+ var win = window.dialogArguments || opener || parent || top;
+
tinyMCE = win.tinyMCE;
if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) {
tinyMCE.selectedInstance.getWin().focus();
tinyMCE.execCommand('mceInsertContent', false, h);
} else
win.edInsertContent(win.edCanvas, h);
-} \ No newline at end of file
+}
+
+// thickbox settings
+jQuery(function($) {
+ tb_position = function() {
+ var tbWindow = $('#TB_window');
+ var width = $(window).width();
+ var H = $(window).height();
+ var W = ( 720 < width ) ? 720 : width;
+
+ if ( tbWindow.size() ) {
+ tbWindow.width( W - 50 ).height( H - 45 );
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
+ tbWindow.css({marginLeft: '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
+ };
+
+ return $('a.thickbox').each( function() {
+ var href = $(this).attr('href');
+ if ( ! href ) return;
+ href = href.replace(/&width=[0-9]+/g, '');
+ href = href.replace(/&height=[0-9]+/g, '');
+ $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
+ });
+ };
+
+ $(window).resize( function() { tb_position() } );
+ $(document).ready( function() { tb_position() } );
+});
+
diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js
index 4eb37ee..b42812f 100644
--- a/wp-admin/js/widgets.js
+++ b/wp-admin/js/widgets.js
@@ -13,12 +13,12 @@ jQuery(function($) {
if ( t.is(':visible') ) {
if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
li.css( 'marginLeft', 0 );
- t.siblings('h4').children('a').text( widgetsL10n.edit );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
} else {
t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
if ( width > 250 )
li.css( 'marginLeft', ( width - 250 ) * -1 );
- t.siblings('h4').children('a').text( widgetsL10n.cancel );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
}
t.toggle();
} : function() {
@@ -28,12 +28,12 @@ jQuery(function($) {
if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
if ( width > 250 )
li.animate( { marginLeft: 0 } );
- t.siblings('h4').children('a').text( widgetsL10n.edit );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
} else {
t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
if ( width > 250 )
li.animate( { marginLeft: ( width - 250 ) * -1 } );
- t.siblings('h4').children('a').text( widgetsL10n.cancel );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
}
t.animate( { height: 'toggle' } );
};
diff --git a/wp-admin/media.php b/wp-admin/media.php
index 2508810..03b3749 100644
--- a/wp-admin/media.php
+++ b/wp-admin/media.php
@@ -92,7 +92,7 @@ case 'edit' :
<?php wp_original_referer_field(true, 'previous'); ?>
<?php wp_nonce_field('media-form'); ?>
</p>
-
+</form>
</div>
diff --git a/wp-admin/menu.php b/wp-admin/menu.php
index 3db528f..81f9b33 100644
--- a/wp-admin/menu.php
+++ b/wp-admin/menu.php
@@ -23,7 +23,7 @@ else
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$menu[15] = array(__('Design'), 'switch_themes', 'themes.php');
-$menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'>$awaiting_mod</span></span>" ), 'edit_posts', 'edit-comments.php');
+$menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php');
$menu[30] = array(__('Settings'), 'manage_options', 'options-general.php');
$menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
if ( current_user_can('edit_users') )
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index 1cd1a89..8e6b707 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -93,11 +93,11 @@ if (empty($plugins)) {
$inactive = get_option('deactivated_plugins');
if ( !empty($active) ) {
?>
- <a class="button-secondary" href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>" class="delete"><?php _e('Deactivate All Plugins'); ?></a>
+ <a class="button-secondary delete" href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>"><?php _e('Deactivate All Plugins'); ?></a>
<?php
} elseif ( empty($active) && !empty($inactive) ) {
?>
- <a class="button-secondary" href="<?php echo wp_nonce_url('plugins.php?action=reactivate-all', 'reactivate-all'); ?>" class="delete"><?php _e('Reactivate Plugins'); ?></a>
+ <a class="button-secondary delete" href="<?php echo wp_nonce_url('plugins.php?action=reactivate-all', 'reactivate-all'); ?>"><?php _e('Reactivate Plugins'); ?></a>
<?php
} // endif active/inactive plugin check
?>
diff --git a/wp-admin/update.php b/wp-admin/update.php
index 34e9380..be95102 100644
--- a/wp-admin/update.php
+++ b/wp-admin/update.php
@@ -22,7 +22,7 @@ function request_filesystem_credentials($form_post, $type = '', $error = false)
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']);
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']);
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']);
- $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : (!empty($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']);
+ $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : ( isset($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']);
if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) {
$stored_credentials = $credentials;
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index 8ee9c05..b01c3a8 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -171,7 +171,7 @@ include ('admin-header.php');
<th scope="row"><?php _e('Admin Color Scheme')?></th>
<td>
<?php
-$current_color = get_user_option('admin_color');
+$current_color = get_user_option('admin_color', $user_id);
if ( empty($current_color) )
$current_color = 'fresh';
foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php
index 83264e4..5e4659e 100644
--- a/wp-admin/widgets.php
+++ b/wp-admin/widgets.php
@@ -134,7 +134,9 @@ if ( isset($_GET['add']) && $_GET['add'] ) {
<ul class="widget-control-list">
<li class="widget-list-control-item">
+ <div class="widget-top">
<h4 class="widget-title"><?php echo $control['name']; ?></h4>
+ </div>
<div class="widget-control" style="display: block;">
<?php
call_user_func_array( $control_callback, $control['params'] );
diff --git a/wp-content/themes/classic/index.php b/wp-content/themes/classic/index.php
index 5965562..d6ca2ca 100644
--- a/wp-content/themes/classic/index.php
+++ b/wp-content/themes/classic/index.php
@@ -27,6 +27,6 @@ get_header();
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
-<?php posts_nav_link(' &#8212; ', __('&laquo; Older Posts'), __('Newer Posts &raquo;')); ?>
+<?php posts_nav_link(' &#8212; ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?>
<?php get_footer(); ?>
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 63e6b1b..57af654 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -726,6 +726,11 @@ function wp_set_comment_status($comment_id, $comment_status) {
break;
case 'approve':
$query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1";
+ if ( get_option('comments_notify') ) {
+ $comment = get_comment($comment_id);
+ wp_notify_postauthor($comment_id, $comment->comment_type);
+ }
+
break;
case 'spam':
$query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 6d37b02..89b4333 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1431,6 +1431,7 @@ function _config_wp_siteurl( $url = '' ) {
return $url;
}
+
function _mce_set_direction( $input ) {
global $wp_locale;
@@ -1443,6 +1444,7 @@ function _mce_set_direction( $input ) {
return $input;
}
+
function smilies_init() {
global $wpsmiliestrans, $wp_smiliessearch, $wp_smiliesreplace;
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 052f55b..4a7f1bb 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -343,13 +343,17 @@ function get_archives_link($url, $text, $format = 'html', $before = '', $after =
$url = clean_url($url);
if ('link' == $format)
- return "\t<link rel='archives' title='$title_text' href='$url' />\n";
+ $link_html = "\t<link rel='archives' title='$title_text' href='$url' />\n";
elseif ('option' == $format)
- return "\t<option value='$url'>$before $text $after</option>\n";
+ $link_html = "\t<option value='$url'>$before $text $after</option>\n";
elseif ('html' == $format)
- return "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n";
+ $link_html = "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n";
else // custom
- return "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
+ $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
+
+ $link_html = apply_filters( "get_archives_link", $link_html );
+
+ return $link_html;
}
diff --git a/wp-includes/js/swfupload/handlers.js b/wp-includes/js/swfupload/handlers.js
index 92eb8ac..75ce85c 100644
--- a/wp-includes/js/swfupload/handlers.js
+++ b/wp-includes/js/swfupload/handlers.js
@@ -55,7 +55,7 @@ function prepareMediaItemInit(fileObj) {
jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new'));
// Also bind toggle to the links
- jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150);jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;});
+ jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){window.scrollTo(0,this.parentNode.offsetTop);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;});
// Bind AJAX to the new Delete button
jQuery('#media-item-' + fileObj.id + ' a.delete').bind('click',function(){
diff --git a/wp-includes/js/thickbox/thickbox.css b/wp-includes/js/thickbox/thickbox.css
index 0552cc5..dc502a7 100644
--- a/wp-includes/js/thickbox/thickbox.css
+++ b/wp-includes/js/thickbox/thickbox.css
@@ -45,19 +45,17 @@
#TB_window {
position: fixed;
- background: #ffffff;
z-index: 102;
color:#000000;
display:none;
- border: 4px solid #525252;
text-align:left;
- top:50%;
+ top:20px;
left:50%;
}
* html #TB_window { /* ie6 hack */
position: absolute;
-margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+margin-top: expression(20) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}
#TB_window img#TB_Image {
@@ -97,6 +95,9 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d
#TB_title{
background-color:#e8e8e8;
height:27px;
+ border-width: 4px;
+ border-color: #525252;
+ border-style: solid solid none;
}
#TB_ajaxContent{
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 74da3e7..92f57e4 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -184,7 +184,7 @@ function get_attachment_link($id = false) {
else
$name = $object->post_name;
if (strpos($parentlink, '?') === false)
- $link = trailingslashit($parentlink) . $name . '/';
+ $link = user_trailingslashit( trailingslashit($parentlink) . $name );
}
if (! $link ) {
@@ -402,7 +402,7 @@ function get_tag_feed_link($tag_id, $feed = '') {
$feed_link = 'feed';
else
$feed_link = "feed/$feed";
- $link = $link . user_trailingslashit($feed_link, 'feed');
+ $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
}
$link = apply_filters('tag_feed_link', $link, $feed);
diff --git a/wp-includes/media.php b/wp-includes/media.php
index f43a2f0..dc7da3a 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -90,16 +90,34 @@ function image_downsize($id, $size = 'medium') {
}
-// return an <img src /> tag for the given image attachment, scaling it down if requested
+/**
+ * An <img src /> tag for an image attachment, scaling it down if requested.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @uses apply_filters() The 'get_image_tag_class' filter is the IMG element
+ * class attribute.
+ * @uses apply_filters() The 'get_image_tag' filter is the full IMG element with
+ * all attributes.
+ *
+ * @param int $id Attachment ID.
+ * @param string $alt Image Description for the alt attribute.
+ * @param string $title Image Description for the title attribute.
+ * @param string $align Part of the class name for aligning the image.
+ * @param string $size Optional. Default is 'medium'.
+ * @return string HTML IMG element for given image attachment
+ */
function get_image_tag($id, $alt, $title, $align, $size='medium') {
list( $img_src, $width, $height ) = image_downsize($id, $size);
$hwstring = image_hwstring($width, $height);
- $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id.'" />';
+ $class = 'align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id;
+ $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
- $url = '';
- $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );
+ $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="'.$class.'" />';
+
+ $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
return $html;
}
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 8219da6..cf76638 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -199,12 +199,11 @@ function &get_post(&$post, $output = OBJECT, $filter = 'raw') {
* @subpackage Post
* @since 2.5
*
- * @param string $field {@internal Missing Description}}
- * @param int|object &$post post ID or post object
+ * @param int|object $post post ID or post object
* @return array of ancestor IDs
*/
function get_post_ancestors($post) {
- $post = get_post();
+ $post = get_post($post);
if ( !empty($post->ancestors) )
return $post->ancestors;
@@ -1164,7 +1163,7 @@ function wp_get_single_post($postid = 0, $mode = OBJECT) {
* @param array $postarr post contents
* @return int post ID or 0 on error
*/
-function wp_insert_post($postarr = array()) {
+function wp_insert_post($postarr = array(), $wp_error = false) {
global $wpdb, $wp_rewrite, $user_ID;
$defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
@@ -1187,8 +1186,12 @@ function wp_insert_post($postarr = array()) {
$previous_status = 'new';
}
- if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) )
- return 0;
+ if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) {
+ if ( $wp_error )
+ return new WP_Error('empty_content', __('Content, title, and excerpt are empty.'));
+ else
+ return 0;
+ }
// Make sure we set a valid category
if (0 == count($post_category) || !is_array($post_category)) {
@@ -1285,8 +1288,7 @@ function wp_insert_post($postarr = array()) {
$suffix = 2;
do {
$alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). "-$suffix";
- // expected_slashed ($alt_post_name, $post_name, $post_type)
- $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != %d AND post_parent = %d LIMIT 1", $post_ID, $post_parent));
+ $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_type, $post_ID, $post_parent));
$suffix++;
} while ($post_name_check);
$post_name = $alt_post_name;
@@ -1300,10 +1302,20 @@ function wp_insert_post($postarr = array()) {
if ($update) {
do_action( 'pre_post_update', $post_ID );
- $wpdb->update( $wpdb->posts, $data, $where );
+ if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
+ if ( $wp_error )
+ return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error);
+ else
+ return 0;
+ }
} else {
$data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update
- $wpdb->insert( $wpdb->posts, $data );
+ if ( false === $wpdb->insert( $wpdb->posts, $data ) ) {
+ if ( $wp_error )
+ return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error);
+ else
+ return 0;
+ }
$post_ID = (int) $wpdb->insert_id;
// use the newly generated $post_ID
@@ -1320,19 +1332,29 @@ function wp_insert_post($postarr = array()) {
$current_guid = get_post_field( 'guid', $post_ID );
- if ( 'page' == $post_type ) {
+ if ( 'page' == $post_type )
clean_page_cache($post_ID);
- } else {
+ else
clean_post_cache($post_ID);
- }
// Set GUID
if ( !$update && '' == $current_guid )
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );
$post = get_post($post_ID);
- if ( !empty($page_template) )
+
+ if ( !empty($page_template) && 'page' == $post_type ) {
$post->page_template = $page_template;
+ $page_templates = get_page_templates();
+ if ( 'default' != $page_template && !in_array($page_template, $page_templates) ) {
+ if ( $wp_error )
+ return new WP_Error('invalid_page_template', __('The page template is invalid.'));
+ else
+ return 0;
+ }
+ if ( ! update_post_meta($post_ID, '_wp_page_template', $page_template) )
+ add_post_meta($post_ID, '_wp_page_template', $page_template, true);
+ }
wp_transition_post_status($post_status, $previous_status, $post);
@@ -2943,10 +2965,6 @@ function _publish_post_hook($post_id) {
*/
function _save_post_hook($post_id, $post) {
if ( $post->post_type == 'page' ) {
- if ( !empty($post->page_template) )
- if ( ! update_post_meta($post_id, '_wp_page_template', $post->page_template))
- add_post_meta($post_id, '_wp_page_template', $post->page_template, true);
-
clean_page_cache($post_id);
global $wp_rewrite;
$wp_rewrite->flush_rules();
diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php
index 2229497..176eee0 100644
--- a/wp-includes/rewrite.php
+++ b/wp-includes/rewrite.php
@@ -793,12 +793,12 @@ class WP_Rewrite {
$robots_rewrite = array('robots.txt$' => $this->index . '?robots=1');
//Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
- $default_feeds = array( '.*/wp-atom.php$' => $this->index .'?feed=atom',
- '.*/wp-rdf.php$' => $this->index .'?feed=rdf',
- '.*/wp-rss.php$' => $this->index .'?feed=rss',
- '.*/wp-rss2.php$' => $this->index .'?feed=rss2',
- '.*/wp-feed.php$' => $this->index .'?feed=feed',
- '.*/wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');
+ $default_feeds = array( '.*wp-atom.php$' => $this->index .'?feed=atom',
+ '.*wp-rdf.php$' => $this->index .'?feed=rdf',
+ '.*wp-rss.php$' => $this->index .'?feed=rss',
+ '.*wp-rss2.php$' => $this->index .'?feed=rss2',
+ '.*wp-feed.php$' => $this->index .'?feed=feed',
+ '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');
// Post
$post_rewrite = $this->generate_rewrite_rules($this->permalink_structure, EP_PERMALINK);
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 5ee222c..2bbafa3 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -80,8 +80,8 @@ class WP_Scripts {
$this->add( 'dimensions', '/wp-includes/js/jquery/jquery.dimensions.min.js', array('jquery'), '1.1.2');
$this->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('dimensions'), '1.1');
$this->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20');
- $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1');
- $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2');
+ $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430');
+ $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2-20080430');
$this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2');
$this->localize( 'swfupload-degrade', 'uploadDegradeOptions', array(
'is_lighttpd_before_150' => is_lighttpd_before_150(),
@@ -144,7 +144,7 @@ class WP_Scripts {
'save' => __('Save'),
'cancel' => __('Cancel'),
) );
- $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080519' );
+ $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080422' );
$this->localize( 'post', 'postL10n', array(
'tagsUsed' => __('Tags used on this post:'),
'add' => attribute_escape(__('Add')),
@@ -164,7 +164,7 @@ class WP_Scripts {
'cancel' => __('Cancel'),
'edit' => __('Edit'),
) );
- $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' );
+ $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' );
$this->localize( 'upload', 'uploadL10n', array(
'browseTitle' => attribute_escape(__('Browse your files')),
'back' => __('&laquo; Back'),
@@ -187,7 +187,7 @@ class WP_Scripts {
'saveText' => attribute_escape(__('Save &raquo;')),
'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
) );
- $this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080407c' );
+ $this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080503' );
$this->localize( 'admin-widgets', 'widgetsL10n', array(
'add' => __('Add'),
'edit' => __('Edit'),
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index cc16a61..4418e99 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -1058,14 +1058,14 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
if ( count($taxonomies) > 1 ) {
foreach ( $taxonomies as $index => $taxonomy ) {
$t = get_taxonomy($taxonomy);
- if ( is_array($t->args) && $args != array_merge($args, $t->args) ) {
+ if ( isset($t->args) && is_array($t->args) && $args != array_merge($args, $t->args) ) {
unset($taxonomies[$index]);
$terms = array_merge($terms, wp_get_object_terms($object_ids, $taxonomy, array_merge($args, $t->args)));
}
}
} else {
$t = get_taxonomy($taxonomies[0]);
- if ( is_array($t->args) )
+ if ( isset($t->args) && is_array($t->args) )
$args = array_merge($args, $t->args);
}
@@ -1199,14 +1199,16 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
if ( ! $term_id = is_term($slug) ) {
$maxterm = $wpdb->get_var( "SELECT max(term_id) FROM {$wpdb->terms}" );
$term_id = mt_rand( $maxterm+100, $maxterm+4000 );
- $wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')");
+ if ( false === $wpdb->insert( $wpdb->terms, compact( 'term_id', 'name', 'slug', 'term_group' ) ) )
+ return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb->last_error);
} else if ( is_taxonomy_hierarchical($taxonomy) && !empty($parent) ) {
// If the taxonomy supports hierarchy and the term has a parent, make the slug unique
// by incorporating parent slugs.
$slug = wp_unique_term_slug($slug, (object) $args);
$maxterm = $wpdb->get_var( "SELECT max(term_id) FROM {$wpdb->terms}" );
$term_id = mt_rand( $maxterm+100, $maxterm+4000 );
- $wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')");
+ if ( false === $wpdb->insert( $wpdb->terms, compact( 'term_id','name', 'slug', 'term_group' ) ) )
+ return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb->last_error);
}
if ( empty($slug) ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 9e29068..d2aa5cc 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -8,7 +8,7 @@
*
* @global string $wp_version
*/
-$wp_version = '2.5.1';
+$wp_version = '2.5.2-alpha';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB scheme
@@ -16,7 +16,7 @@ $wp_version = '2.5.1';
*
* @global int $wp_db_version
*/
-$wp_db_version = 7796;
+$wp_db_version = 7935;
-$wpmu_version = '1.5.1';
+$wpmu_version = '1.5.2-alpha';
?>
diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php
index 9fa2630..1c356e6 100644
--- a/wp-includes/widgets.php
+++ b/wp-includes/widgets.php
@@ -710,10 +710,11 @@ function wp_widget_categories($args, $widget_args = 1) {
echo $before_widget;
echo $before_title . $title . $after_title;
- $cat_args = "orderby=name&show_count={$c}&hierarchical={$h}";
+ $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);
if ( $d ) {
- wp_dropdown_categories($cat_args . '&show_option_none= ' . __('Select Category'));
+ $cat_args['show_option_none'] = __('Select Category');
+ wp_dropdown_categories($cat_args);
?>
<script type='text/javascript'>