From 5b8b8fd838a676b0d91797c4132fdd52dea73b70 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 18 Apr 2012 16:21:24 +0000 Subject: [PATCH] Avoid infinite loops by not passing real content text, so other app doesn't try to expand custom fields too --- etemplate/inc/class.bo_merge.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index c8cbfc6b45..68779d3803 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -1145,7 +1145,10 @@ abstract class bo_merge { $classname = "{$field_app}_merge"; $class = new $classname(); - $app_replacements[$field_app] = $class->get_replacements($values['#'.$field], $placeholders[$index]); + // If we send the real content, it can result in infinite loop of lookups + // This means you can't do {{#other_app/#other_app_cf/n_fn}} + $content = ''; + $app_replacements[$field_app] = $class->get_replacements($values['#'.$field], $content); } $replacements[$placeholders[$index]] = $app_replacements[$field_app]['$$'.$sub[$index].'$$']; }