Update of /var/cvs/contributions/natmm/src/nl/leocms/util/tools
In directory james.mmbase.org:/tmp/cvs-serv12305/src/nl/leocms/util/tools

Modified Files:
        HtmlCleaner.java 
Log Message:
NMCMS-606 - Improvement: don't run the whole cleaner when not needed.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/natmm/src/nl/leocms/util/tools
See also: http://www.mmbase.org/jira/browse/NMCMS-606


Index: HtmlCleaner.java
===================================================================
RCS file: 
/var/cvs/contributions/natmm/src/nl/leocms/util/tools/HtmlCleaner.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- HtmlCleaner.java    3 Nov 2008 17:11:24 -0000       1.6
+++ HtmlCleaner.java    10 Nov 2008 15:45:53 -0000      1.7
@@ -536,6 +536,9 @@
    }
 
    public static String cleanHtml(String text) {
+      if (text == null) return null;
+      if (text.equalsIgnoreCase("")) return text;
+      
        // *** everything in capitals ***
        text = replace(text,"<div","<DIV"); text = 
replace(text,"</div","</DIV");
        text = replace(text,"<h1","<H1"); text = replace(text,"</h1","</H1");
@@ -572,7 +575,7 @@
        text = cleanParam(text,"vAlign=");
        text = cleanParam(text,"width=");
        
-       // this looks strange but is intended to remove the crapp that can come 
from the html-area
+       // this looks strange but is intended to remove the crap that can come 
from the html-area
        text = replace(text,"<P >","<P>");
        text = cleanEmptyTag(text,"<P>","<P>","<P><P>");
        text = replace(text,"<P><P>","<P>");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to