### Eclipse Workspace Patch 1.0 #P token Index: token.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/token/Attic/token.inc,v retrieving revision 1.1.2.9 diff -u -r1.1.2.9 token.inc --- token.inc 11 May 2007 22:33:52 -0000 1.1.2.9 +++ token.inc 1 Jun 2007 16:20:52 -0000 @@ -113,7 +113,10 @@ */ function token_get_values($type = 'global', $object = NULL, $flush = FALSE) { static $tokens; - static $depth; + static $obj_depth; + + // Gets the cache id since we'll use it a lot here + $id = _token_get_id($type, $object); // Flush the static token cache. Useful for processes that need to slog through // huge numbers of tokens in a single execution cycle. Flushing it will keep @@ -125,11 +128,14 @@ // Simple recursion check. This is to avoid content_view()'s potential // for endless looping when a filter uses tokens, which load the content // view, which calls the filter, which uses tokens, which... - if (!isset($depth)) { - $depth = 1; + if (!isset($obj_depth)) { + $obj_depth = array(); } - elseif ($depth = 1) { - $depth++; + if (!isset($obj_depth[$id])) { + $obj_depth[$id] = 1; + } + elseif ($obj_depth[$id] == 1) { + $obj_depth[$id]++; } else { // We'll allow things to get two levels deep, but bail out after that @@ -152,7 +158,6 @@ } - $id = _token_get_id($type, $object); if (isset($tokens[$type][$id])) { $tmp_tokens = $tokens[$type][$id]; } @@ -173,7 +178,7 @@ $result->tokens = array_keys($all); $result->values = array_values($all); - $depth--; + $obj_depth[$id]--; return $result; }