Index: wp-includes/plugin.php
===================================================================
--- wp-includes/plugin.php	(revision 26748)
+++ wp-includes/plugin.php	(working copy)
@@ -192,14 +192,41 @@
 	if ( empty($args) )
 		$args = func_get_args();
 
+	$current = current($wp_filter[$tag]);
 	do {
-		foreach( (array) current($wp_filter[$tag]) as $the_ )
-			if ( !is_null($the_['function']) ){
+		foreach( (array) $current as $the_ )
+			if ( $the_['function'] !== null ){
 				$args[1] = $value;
-				$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
+
+				$func = $the_['function'];
+
+				if (!function_exists($func)) {
+					trigger_error("function '$func' not found or invalid function name", E_USER_WARNING);
+					continue;
+				}
+
+				switch ((int) $the_['accepted_args']) {
+					case 1:
+						$value = $func($args[1]);
+						break;
+					case 2:
+						$value = $func($args[1], $args[2]);
+						break;
+					case 3:
+						$value = $func($args[1], $args[2], $args[3]);
+						break;
+					case 4:
+						$value = $func($args[1], $args[2], $args[3], $args[4]);
+						break;
+					case 5:
+						$value = $func($args[1], $args[2], $args[3], $args[4], $args[5]);
+						break;
+					default:
+						$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
+				}
 			}
 
-	} while ( next($wp_filter[$tag]) !== false );
+	} while ( $current = next($wp_filter[$tag]) !== false );
 
 	array_pop( $wp_current_filter );
 
