Author: snoopdave
Date: Wed Apr  6 02:22:44 2011
New Revision: 1089292

URL: http://svn.apache.org/viewvc?rev=1089292&view=rev
Log:
Fix for https://issues.apache.org/jira/browse/ROL-1920

HTMLSubsettting now only does the encoding for text/html

Modified:
    
roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/plugins/comment/HTMLSubsetPlugin.java

Modified: 
roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/plugins/comment/HTMLSubsetPlugin.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/plugins/comment/HTMLSubsetPlugin.java?rev=1089292&r1=1089291&r2=1089292&view=diff
==============================================================================
--- 
roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/plugins/comment/HTMLSubsetPlugin.java
 (original)
+++ 
roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/plugins/comment/HTMLSubsetPlugin.java
 Wed Apr  6 02:22:44 2011
@@ -55,19 +55,20 @@ public class HTMLSubsetPlugin implements
     
     
     public String render(final WeblogEntryComment comment, String text) {
-        
-        log.debug("starting value:\n"+text);
-        
         String output = text;
         
-        // escape html
-        output = Utilities.escapeHTML(output);
-        
-        // just use old utilities method
-        output = Utilities.transformToHTMLSubset(output);
-        
-        log.debug("ending value:\n"+output);
-        
+        // only do this if comment is HTML
+        if ("text/html".equals(comment.getContentType())) {
+            log.debug("ending value:\n" + output);
+                       
+               // escape html
+               output = Utilities.escapeHTML(output);
+               
+               // just use old utilities method
+               output = Utilities.transformToHTMLSubset(output);
+               log.debug("starting value:\n"+text);
+        }
+                
         return output;
     }
     


Reply via email to