|Title|Firefox does not like escaped / char in URL
|Date|26-Jan-2005 05:08:13 EET
|Version|2.1.86 alpha
|[Bug criticality]|MediumBug
|Browser version|Firefox
|[Bug status]|ClosedBug
|[PageProvider] used|
|Servlet Container|Tomcat 4.1.30
|Operating System|Solaris
|Java version|1.4.2_05

When an image is inlined by JSPWiki it escapes the URL including the / char.
This works in IE but causes Firefox to obtain a file from some cache somewhere, the file equates to the first version of any attached image. 

In my case this is bad news since users are developing code based on the diagrams and firefox users will see old versions !!

The following change to com.ecyrd.jspwiki.TextUtil fixed the problem

     *  java.net.URLEncoder.encode() method in JDK < 1.4 is buggy.  This duplicates
     *  its functionality.
    protected static String urlEncode( byte[] rs )
        StringBuffer result = new StringBuffer();

        // Does the URLEncoding.  We could use the java.net one, but
        // it does not eat byte[]s.

        for( int i = 0; i < rs.length; i++ )
            char c = (char) rs[i];

            switch( c )
              case '_':
              case '.':
              case '*':
              case '-':
                result.append( c );
                //we dont want / escaped, it breaks urls in firefox
              case '/':
                  result.append( c );

              case ' ':
                result.append( '+' );



The fix is already in the current alpha release (2.1.144).  Perhaps this would be able to explain [BugStaleAttachments]?

-- JanneJalkanen