Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 40871)
+++ wp-includes/general-template.php	(working copy)
@@ -1604,22 +1604,24 @@
  *
  * @since 1.0.0
  *
- * @param string $url    URL to archive.
- * @param string $text   Archive text description.
- * @param string $format Optional, default is 'html'. Can be 'link', 'option', 'html', or custom.
- * @param string $before Optional. Content to prepend to the description. Default empty.
- * @param string $after  Optional. Content to append to the description. Default empty.
+ * @param string $url      URL to archive.
+ * @param string $text     Archive text description.
+ * @param string $format   Optional, default is 'html'. Can be 'link', 'option', 'html', or custom.
+ * @param string $before   Optional. Content to prepend to the description. Default empty.
+ * @param string $after    Optional. Content to append to the description. Default empty.
+ * @param bool   $selected Optional. Set to true if the current page is the selected archive page
  * @return string HTML link content for archive.
  */
-function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
+function get_archives_link($url, $text, $format = 'html', $before = '', $after = '', $selected = false) {
 	$text = wptexturize($text);
 	$url = esc_url($url);
 
 	if ('link' == $format)
 		$link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n";
-	elseif ('option' == $format)
-		$link_html = "\t<option value='$url'>$before $text $after</option>\n";
-	elseif ('html' == $format)
+	elseif ('option' == $format) {
+		$selected_attr = $selected ? " selected='selected'" : '';
+		$link_html = "\t<option value='$url'$selected_attr>$before $text $after</option>\n";
+	} elseif ('html' == $format)
 		$link_html = "\t<li>$before<a href='$url'>$text</a>$after</li>\n";
 	else // custom
 		$link_html = "\t$before<a href='$url'>$text</a>$after\n";
@@ -1636,8 +1638,9 @@
 	 * @param string $format    Link format. Can be 'link', 'option', 'html', or custom.
 	 * @param string $before    Content to prepend to the description.
 	 * @param string $after     Content to append to the description.
+	 * @param bool   $selected  True if the current page is the selected archive
 	 */
-	return apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after );
+	return apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after, $selected );
 }
 
 /**
@@ -1683,7 +1686,11 @@
 		'format' => 'html', 'before' => '',
 		'after' => '', 'show_post_count' => false,
 		'echo' => 1, 'order' => 'DESC',
-		'post_type' => 'post'
+		'post_type' => 'post',
+		'year' => get_query_var( 'year' ),
+		'monthnum' => get_query_var( 'monthnum' ),
+		'day' => get_query_var( 'day' ),
+		'week' => get_query_var( 'w' )
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -1759,7 +1766,9 @@
 				if ( $r['show_post_count'] ) {
 					$r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
 				}
-				$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
+				$selected = is_archive() && ( string ) $r[ 'year' ] === $result->year
+							&& ( string ) $r[ 'monthnum' ] === $result->month;
+				$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
 			}
 		}
 	} elseif ( 'yearly' == $r['type'] ) {
@@ -1781,7 +1790,8 @@
 				if ( $r['show_post_count'] ) {
 					$r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
 				}
-				$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
+				$selected = is_archive() && ( string ) $r[ 'year' ] === $result->year;
+				$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
 			}
 		}
 	} elseif ( 'daily' == $r['type'] ) {
@@ -1804,7 +1814,10 @@
 				if ( $r['show_post_count'] ) {
 					$r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
 				}
-				$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
+				$selected = is_archive() && ( string ) $r[ 'year' ] === $result->year
+							&& ( string ) $r[ 'monthnum' ] === $result->month
+							&& ( string ) $r[ 'day' ] === $result->dayofmonth;
+				$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
 			}
 		}
 	} elseif ( 'weekly' == $r['type'] ) {
@@ -1834,7 +1847,9 @@
 					if ( $r['show_post_count'] ) {
 						$r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
 					}
-					$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
+					$selected = is_archive() && ( string ) $r[ 'year' ] === $result->yr
+								&& ( string ) $r[ 'week' ] === $result->week;
+					$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
 				}
 			}
 		}
@@ -1857,7 +1872,8 @@
 					} else {
 						$text = $result->ID;
 					}
-					$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
+					$selected = $result->ID === get_the_ID();
+					$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
 				}
 			}
 		}
