Index: wordpress/wp-includes/plugin.php
===================================================================
--- wordpress/wp-includes/plugin.php	(revision 6270)
+++ wordpress/wp-includes/plugin.php	(working copy)
@@ -40,7 +40,7 @@
  * @return string The text in <tt>$string</tt> after all hooked functions are applied to it.
  */
 function apply_filters($tag, $string) {
-	global $wp_filter, $merged_filters;
+	global $wp_filter, $merged_filters, $wp_current_filter;
 
 	if ( !isset( $merged_filters[ $tag ] ) )
 		merge_filters($tag);
@@ -51,6 +51,9 @@
 	reset( $wp_filter[ $tag ] );
 
 	$args = func_get_args();
+	
+	$last_filter = @$wp_current_filter;
+	$wp_current_filter = $tag;
 
 	do{
 		foreach( (array) current($wp_filter[$tag]) as $the_ )
@@ -61,6 +64,8 @@
 
 	} while ( next($wp_filter[$tag]) !== false );
 
+	$wp_current_filter = $last_filter;
+
 	return $string;
 }
 
@@ -138,7 +143,7 @@
  * @param mixed $arg,... Optional additional arguments which are passed on to the functions hooked to the action.
  */
 function do_action($tag, $arg = '') {
-	global $wp_filter, $wp_actions;
+	global $wp_filter, $wp_actions, $wp_current_action;
 
 	if ( is_array($wp_actions) )
 		$wp_actions[] = $tag;
@@ -158,6 +163,9 @@
 	if ( !isset($wp_filter[$tag]) )
 		return;
 
+	$last_action = @$wp_current_action;
+	$wp_current_action = $tag;
+
 	do{
 		foreach( (array) current($wp_filter[$tag]) as $the_ )
 			if ( !is_null($the_['function']) )
@@ -165,6 +173,7 @@
 
 	} while ( next($wp_filter[$tag]) !== false );
 
+	$wp_current_action = $last_action;
 }
 
 /**
