diff -r f507feede89a -r 09a1c134465b web/wp-admin/includes/dashboard.php --- a/web/wp-admin/includes/dashboard.php Wed Dec 19 12:35:13 2012 -0800 +++ b/web/wp-admin/includes/dashboard.php Wed Dec 19 17:46:52 2012 -0800 @@ -131,6 +131,7 @@ } if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) { + check_admin_referer( 'edit-dashboard-widget_' . $_POST['widget_id'], 'dashboard-widget-nonce' ); ob_start(); // hack - but the same hack wp-admin/widgets.php uses wp_dashboard_trigger_widget_control( $_POST['widget_id'] ); ob_end_clean(); @@ -182,6 +183,7 @@ function _wp_dashboard_control_callback( $dashboard, $meta_box ) { echo '
'; wp_dashboard_trigger_widget_control( $meta_box['id'] ); + wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' ); echo ''; submit_button( __('Submit') ); echo '
'; @@ -392,12 +394,12 @@ } echo '

'; - // Check if search engines are blocked. + // Check if search engines are asked not to index this site. if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ) { $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ); - $content = apply_filters('privacy_on_link_text', __('Search Engines Blocked') ); + $content = apply_filters('privacy_on_link_text', __('Search Engines Discouraged') ); - echo "

$content

"; + echo "

$content

"; } update_right_now_message(); @@ -480,7 +482,7 @@ if ( $drafts_query->posts ) $drafts =& $drafts_query->posts; } - printf('

' . __('You can also try %s, easy blogging from anywhere on the Web.') . '

', '' . __('Press This') . '' ); + printf('

' . __('You can also try %s, easy blogging from anywhere on the Web.') . '

', '' . __('Press This') . '' ); $_REQUEST = array(); // hack for get_default_post_to_edit() } @@ -490,22 +492,35 @@ $post = get_post( $last_post_id ); if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore $post = get_default_post_to_edit('post', true); - update_user_option( (int) $GLOBALS['current_user']->ID, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID + update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID } else { $post->post_title = ''; // Remove the auto draft title } } else { - $post = get_default_post_to_edit('post', true); - update_user_option( (int) $GLOBALS['current_user']->ID, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID + $post = get_default_post_to_edit( 'post' , true); + $user_id = get_current_user_id(); + // Don't create an option if this is a super admin who does not belong to this site. + if ( ! ( is_super_admin( $user_id ) && ! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) ) ) + update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID } $post_ID = (int) $post->ID; + + $media_settings = array( + 'id' => $post->ID, + 'nonce' => wp_create_nonce( 'update-post_' . $post->ID ), + ); + + if ( current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' ) ) { + $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true ); + $media_settings['featuredImageId'] = $featured_image_id ? $featured_image_id : -1; + } ?>
-

-
- +
+ +
@@ -514,29 +529,37 @@
-

- + +
- + -

-
- +
+ +

+ + + + - 'save-post', 'tabindex'=> 4 ) ); ?> + 'save-post' ) ); ?> - - - -

@@ -566,7 +589,7 @@ $url = get_edit_post_link( $draft->ID ); $title = _draft_or_post_title( $draft->ID ); $item = "

" . esc_html($title) . " " . get_the_time( get_option( 'date_format' ), $draft ) . '

'; - if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) ) + if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) ) $item .= '

' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '

'; $list[] = $item; } @@ -614,7 +637,7 @@ } if ( $comments ) { - echo '
'; + echo '
'; foreach ( $comments as $comment ) _wp_dashboard_recent_comments_row( $comment ); echo '
'; @@ -657,15 +680,15 @@ $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); - $actions['approve'] = "" . __( 'Approve' ) . ''; - $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; + $actions['approve'] = "" . __( 'Approve' ) . ''; + $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; $actions['edit'] = "". __('Edit') . ''; $actions['reply'] = '' . __('Reply') . ''; - $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; + $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; if ( !EMPTY_TRASH_DAYS ) - $actions['delete'] = "" . __('Delete Permanently') . ''; + $actions['delete'] = "" . __('Delete Permanently') . ''; else - $actions['trash'] = "" . _x('Trash', 'verb') . ''; + $actions['trash'] = "" . _x('Trash', 'verb') . ''; $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment ); @@ -813,10 +836,13 @@ /* translators: incoming links feed, %1$s is other person, %3$s is content */ $text = __( '%1$s linked here saying, "%3$s"' ); - if ( !empty($show_date) ) { - if ( !empty($show_author) || !empty($show_summary) ) - /* translators: incoming links feed, %4$s is the date */ - $text .= ' ' . __( 'on %4$s' ); + if ( !empty( $show_date ) ) { + if ( $link ) + /* translators: incoming links feed, %1$s is other person, %3$s is content, %4$s is the date */ + $text = __( '%1$s linked here saying, "%3$s" on %4$s' ); + else + /* translators: incoming links feed, %1$s is other person, %3$s is content, %4$s is the date */ + $text = __( '%1$s linked here saying, "%3$s" on %4$s' ); $date = esc_html( strip_tags( $item->get_date() ) ); $date = strtotime( $date ); $date = gmdate( get_option( 'date_format' ), $date ); @@ -913,7 +939,7 @@ if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { $plugin_slugs = array_keys( get_plugins() ); - set_transient( 'plugin_slugs', $plugin_slugs, 86400 ); + set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); } foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins') ) as $feed => $label ) { @@ -961,12 +987,7 @@ if ( !isset($items[$item_key]) ) continue; - // current bbPress feed item titles are: user on "topic title" - if ( preg_match( '/"(.*)"/s', $item->get_title(), $matches ) ) - $title = $matches[1]; - else // but let's make it forward compatible if things change - $title = $item->get_title(); - $title = esc_html( $title ); + $title = esc_html( $item->get_title() ); $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) ); @@ -1026,7 +1047,7 @@ array_unshift( $args, $widget_id ); ob_start(); call_user_func_array( $callback, $args ); - set_transient( $cache_key, ob_get_flush(), 43200); // Default lifetime in cache of 12 hours (same as the feeds) + set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS ); // Default lifetime in cache of 12 hours (same as the feeds) } return true; @@ -1099,7 +1120,7 @@ return true; $quota = get_space_allowed(); - $used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024; + $used = get_space_used(); if ( $used > $quota ) $percentused = '100'; @@ -1114,7 +1135,7 @@
- +
%2$sMB' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?>%2$sMB' ), esc_url( admin_url( 'upload.php' ) ), number_format_i18n( $quota ) ); ?>
@@ -1122,7 +1143,7 @@
- +
%2$sMB (%3$s%%)' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?>%2$sMB (%3$s%%)' ), esc_url( admin_url( 'upload.php' ) ), number_format_i18n( $used, 2 ), $percentused ); ?>
@@ -1217,7 +1238,7 @@ if ( ! is_array( $response ) ) return false; - set_site_transient( 'browser_' . $key, $response, 604800 ); // cache for 1 week + set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS ); } return $response; @@ -1234,93 +1255,45 @@ * @since 3.3.0 */ function wp_welcome_panel() { - global $wp_version; - - if ( ! current_user_can( 'edit_theme_options' ) ) - return; - - $classes = 'welcome-panel'; - - $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); - // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner - $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) ); - if ( $hide ) - $classes .= ' hidden'; - - list( $display_version ) = explode( '-', $wp_version ); ?> -
- - -
-
-

-

First Steps with WordPress. If you’d rather dive right in, here are a few things most people do first when they set up a new WordPress site. If you need help, use the Help tabs in the upper right corner to get information on how to use your current screen and where to go for more assistance.' ); ?>

+

+

-

-

-
    -
  • Choose your privacy setting' ), esc_url( admin_url('options-privacy.php') ) ); ?>
  • -
  • Select your tagline and time zone' ), esc_url( admin_url('options-general.php') ) ); ?>
  • -
  • Turn comments on or off' ), esc_url( admin_url('options-discussion.php') ) ); ?>
  • -
  • Fill in your profile' ), esc_url( admin_url('profile.php') ) ); ?>
  • -
+

+ + + true ) ) ) > 1 ) ) : ?> +

change your theme completely' ), admin_url( 'themes.php' ) ); ?>

+
-

-

+

    -
  • sample page and post' ), esc_url( get_permalink( 2 ) ), esc_url( get_permalink( 1 ) ) ); ?>
  • -
  • sample page and post' ), esc_url( admin_url('edit.php?post_type=page') ), esc_url( admin_url('edit.php') ) ); ?>
  • -
  • Create an About Me page' ), esc_url( admin_url('edit.php?post_type=page') ) ); ?>
  • -
  • Write your first post' ), esc_url( admin_url('post-new.php') ) ); ?>
  • + +
  • ' . __( 'Edit your front page' ) . '', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?>
  • +
  • ' . __( 'Add additional pages' ) . '', admin_url( 'post-new.php?post_type=page' ) ); ?>
  • + +
  • ' . __( 'Edit your front page' ) . '', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?>
  • +
  • ' . __( 'Add additional pages' ) . '', admin_url( 'post-new.php?post_type=page' ) ); ?>
  • +
  • ' . __( 'Add a blog post' ) . '', admin_url( 'post-new.php' ) ); ?>
  • + +
  • ' . __( 'Write your first blog post' ) . '', admin_url( 'post-new.php' ) ); ?>
  • +
  • ' . __( 'Add an About page' ) . '', admin_url( 'post-new.php?post_type=page' ) ); ?>
  • + +
  • ' . __( 'View your site' ) . '', home_url( '/' ) ); ?>
-

- errors() ) : - echo '

'; - printf( __( 'Install a theme to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) ); - echo '

'; - else: - $customize_links = array(); - if ( 'twentyeleven' == $theme->get_stylesheet() ) - $customize_links[] = sprintf( __( 'Choose light or dark' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) ); - - if ( current_theme_supports( 'custom-background' ) ) - $customize_links[] = sprintf( __( 'Set a background color' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) ); - - if ( current_theme_supports( 'custom-header' ) ) - $customize_links[] = sprintf( __( 'Select a new header image' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) ); - - if ( current_theme_supports( 'widgets' ) ) - $customize_links[] = sprintf( __( 'Add some widgets' ), esc_url( admin_url( 'widgets.php' ) ) ); - - if ( ! empty( $customize_links ) ) { - echo '

'; - printf( __( 'Use the current theme — %1$s — or choose a new one. If you stick with %1$s, here are a few ways to make your site look unique.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) ); - echo '

'; - ?> -
    - -
  • - -
- '; - printf( __( 'Use the current theme — %1$s — or choose a new one.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) ); - echo '

'; - } - endif; ?> +

+
', admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' ) ); ?> +
  • ' . __( 'Turn comments on or off' ) . '', admin_url( 'options-discussion.php' ) ); ?>
  • +
  • ' . __( 'Learn more about getting started' ) . '', __( 'http://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?>
  • +
    -

    Dismiss this message.' ), esc_url( admin_url( '?welcome=0' ) ) ); ?>

    -