[Building Sakai] Fixing Validate.encodeUrl?`

David Horwitz david.horwitz at uct.ac.za
Sat Feb 13 01:48:00 PST 2010


Hi Jim,

Thanks for the feedback. FYI what I've been doing under my maintenance
team hat is working through the list of bugs relating to handling files
with odd characters in them (see SAK-17980 for a collection) Many of
these have been fixed by escaping the resource URL's in the kernel,
however a few remain like SAK-16412. In all cases I'm adding unit tests
to the kernel to test saving and retrieving these files.

The SAK-16412 problem (files saved in webdav with a ' or " in the title)
actually seems to be a issue with Validator.escapeResourceName(String)
as this changes the ' to _ (and will do so for any reserved
characters).  This is always going to cause problems for dav which
expects CHS to behave like a file system. I'm now wondering if we still
need to be this strict on escaping now that we escape the urls?

David


> David,
>
> It seems to me that this issue comes up about once a year, but the  
> last time it was discussed may have been just a few months ago.  If I  
> recall correctly, previous attempts to fix this in the way you suggest  
> caused other problems, and the changes had to be backed out.  Maybe  
> I'm confusing this with some other method(s).
>
> Since this method is deprecated, maybe it would make more sense to use  
> some other method in places where this causes a problem, rather than  
> changing this method and risking that you will be causing some other  
> part of the code to stop working as expected.
>
> I'm not defending the implementation of this method.  I'm just  
> suggesting that because it is used (or was used at one time) in many  
> places throughout sakai, it would be hard to test whether your  
> proposed change had dire side effects.  Seems like it would be better  
> to use URLEncoder.encode(url, "utf8") directly in the places where  
> Validator.escapeUrl(str) causes a problem.
>
> Jim
>   


More information about the sakai-dev mailing list