You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sv...@apache.org on 2005/08/22 04:04:41 UTC

svn commit: r234414 - /myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java

Author: svieujot
Date: Sun Aug 21 19:04:37 2005
New Revision: 234414

URL: http://svn.apache.org/viewcvs?rev=234414&view=rev
Log:
inputHtml : bugfix for empty texts.

Modified:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java?rev=234414&r1=234413&r2=234414&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/inputHtml/InputHtml.java Sun Aug 21 19:04:37 2005
@@ -359,10 +359,14 @@
         bodyStartIndex++;
 
         int bodyEndIndex = lcText.lastIndexOf("</body>")-1;
-
+        
         if( bodyStartIndex<0 || bodyEndIndex<0
            || bodyStartIndex > bodyEndIndex
            || bodyStartIndex>=textLength || bodyEndIndex>=textLength ){
+
+        	if( lcText.indexOf("<body/>")==-1 || lcText.indexOf("<body />")==-1 )
+        		return "";
+        	
         	log.warn("Couldn't extract HTML body from :\n"+html);
             return html.trim();
         }