Author: lektran
Date: Fri Apr  2 03:37:33 2010
New Revision: 930156

URL: http://svn.apache.org/viewvc?rev=930156&view=rev
Log:
Log an error and ignore decoratorContentId if it is the same as the contentId 
being rendered.  Prevents a stack overflow.

Modified:
    
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Modified: 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=930156&r1=930155&r2=930156&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
 Fri Apr  2 03:37:33 2010
@@ -222,6 +222,11 @@ public class ContentWorker implements or
 
         // look for a content decorator
         String contentDecoratorId = content.getString("decoratorContentId");
+        // Check that the decoratorContent is not the same as the current 
content
+        if (contentId.equals(contentDecoratorId)) {
+            Debug.logError("[" + contentId + "] decoratorContentId is the same 
as contentId, ignoring.", module);
+            contentDecoratorId = null;
+        }
         // check to see if the decorator has already been run
         boolean isDecorated = 
Boolean.TRUE.equals(templateContext.get("_IS_DECORATED_"));
         if (!isDecorated && UtilValidate.isNotEmpty(contentDecoratorId)) {


Reply via email to