URL encoding for OpenURL fails when encountering certain characters

Description

The OpenURL encoding happening in the Citation Service is not robust enough. For example, when retrieving a citation title that contains a quotation character ("), SFX fails to read past the first occurrence of the character within the OpenURL. Since the title is a field that comes early in the OpenURL, the trailing fields are not recognized and the resulting SFX Menu provides inaccurate and unhelpful information.

A fix to this would be to modify the OpenURL encoding code in the Citation Service to be more robust than simply find/replace on certain characters.

Environment

applies to all environments

Activity

Show:

Gaurav Cedric Bhatnagar November 1, 2006 at 3:26 PM

For now, I've added in the use of java.net.URLEncoder.encode() to encode each openURL parameter value. This is a simple, static method that uses UTF-8 to encode the openURL parameters and solves the openURL failing on special characters.

The openUrlEncode() method is no longer needed and has been removed. I've also added year information to the rft.date openURL parameter - this greatly improves the performance of openURL resolution.

If we decide this doesn't work out and are able to use something within Sakai (like the Validator class), we can always reopen the bug and change the implementation. For now using URLEncoder.encode() was a pretty easy modification and is working very well.

Jim Eng November 1, 2006 at 10:18 AM

Let's discuss the requirements for this. Sakai already has a set of escape methods in org.sakaiproject.util.Validator (see http://source.sakaiproject.org/release/2.2.0/javadoc/org/sakaiproject/util/Validator.html). We may find one there that does what we need. Or we may want to add a method to that class to get a valid URL.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created November 1, 2006 at 10:00 AM
Updated November 30, 2012 at 5:59 AM
Resolved November 1, 2006 at 3:26 PM