Skip to content

Commit

Permalink
SAK-20359 - Syllabus attachments are storing the full absolute URL in…
Browse files Browse the repository at this point in the history
…stead of the relative URL

git-svn-id: https://source.sakaiproject.org/svn/syllabus/trunk@92712 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
gjthomas committed May 9, 2011
1 parent 01c6d2f commit 5f3f765
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.sakaiproject.api.app.syllabus.SyllabusData;
import org.sakaiproject.api.app.syllabus.SyllabusItem;
import org.sakaiproject.api.app.syllabus.SyllabusManager;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.content.api.ContentHostingService;
import org.sakaiproject.content.api.ContentResource;
import org.sakaiproject.user.cover.UserDirectoryService;
Expand Down Expand Up @@ -470,6 +471,8 @@ public SyllabusAttachment createSyllabusAttachmentObject(String attachId, String
attach.setLastModifiedBy(modifier.getDisplayName());
attach.setType(cr.getContentType());
String tempString = cr.getUrl();
String surl = ServerConfigurationService.getServerUrl();
tempString = tempString.indexOf(surl) > 0 ? tempString : tempString.substring(surl.length());
String newString = new String();
char[] oneChar = new char[1];
for(int i=0; i<tempString.length(); i++)
Expand Down

0 comments on commit 5f3f765

Please sign in to comment.