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/05/21 01:54:13 UTC

svn commit: r171172 - /myfaces/trunk/src/components/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java

Author: svieujot
Date: Fri May 20 16:54:11 2005
New Revision: 171172

URL: http://svn.apache.org/viewcvs?rev=171172&view=rev
Log:
InputHtmlRenderer bugfix : remove possible infinite loop.

Modified:
    myfaces/trunk/src/components/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java

Modified: myfaces/trunk/src/components/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java?rev=171172&r1=171171&r2=171172&view=diff
==============================================================================
--- myfaces/trunk/src/components/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java (original)
+++ myfaces/trunk/src/components/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java Fri May 20 16:54:11 2005
@@ -67,7 +67,6 @@
     }
 
 	private void encodeDisplayValueOnly(FacesContext context, InputHtml editor) throws IOException {
-		String clientId = editor.getClientId(context);
 		// Use only a textarea
 		ResponseWriter writer = context.getResponseWriter();
         writer.startElement(HTML.SPAN_ELEM, editor);
@@ -111,22 +110,23 @@
 	private static String getHtmlBody(String html){
 		String lcText = html.toLowerCase();
         int textLength = lcText.length();
-        int bodyStartIndex = 0;
+        int bodyStartIndex = -1;
         while(bodyStartIndex < textLength){
-            bodyStartIndex = lcText.indexOf("<body");
+        	bodyStartIndex++;
+            bodyStartIndex = lcText.indexOf("<body", bodyStartIndex);
             if( bodyStartIndex == -1 )
                 break; // not found.
 
             bodyStartIndex += 5;
             char c = lcText.charAt(bodyStartIndex);
-            if( c=='>' ){
+            if( c=='>' )
                 break;
-            }
 
             if( c!=' ' && c!='\t' )
                 continue;
 
             bodyStartIndex = lcText.indexOf('>', bodyStartIndex);
+            break;
         }
         bodyStartIndex++;