### 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 4 Jun 2007 16:53:52 -0000 @@ -113,7 +113,7 @@ */ function token_get_values($type = 'global', $object = NULL, $flush = FALSE) { static $tokens; - static $depth; + static $running; // 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,13 +125,7 @@ // 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; - } - elseif ($depth = 1) { - $depth++; - } - else { + if ($running) { // We'll allow things to get two levels deep, but bail out after that // without performing any substitutions. $result = new stdClass(); @@ -139,6 +133,8 @@ $result->values = array(); return $result; } + + $running = TRUE; $path = drupal_get_path('module', 'token'); include_once("$path/token_node.inc"); @@ -173,7 +169,7 @@ $result->tokens = array_keys($all); $result->values = array_values($all); - $depth--; + $running = FALSE; return $result; }