Trailing Spaces in Folder Names effect HTML Export

Bug #813905 reported by Scott William Gage
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Melissa Draper

Bug Description

Found an issue with a student's HTML export where files would be present in the zip file, but the zip extractor (in this case WinRAR) reported the following:

! C:\Users\gagesw\Downloads\Mahara\mahara-export-html-user230-1311221980.zip: Cannot create portfolio-for-gagesw\files\file\Here is a folder with trailing spaces \title-vidmaster.gif
    The system cannot find the path specified.
! C:\Users\gagesw\Downloads\Mahara\mahara-export-html-user230-1311221980.zip: Attempting to correct the invalid file name
! C:\Users\gagesw\Downloads\Mahara\mahara-export-html-user230-1311221980.zip: Renaming portfolio-for-gagesw\files\file\Here is a folder with trailing spaces

While this fixes the issue, the HTML pages are generated before the zip is even created so all its references to files in the folder will be broken.

Regarding the folder itself in the file area, the user can fix the folder name but they may not even notice the issue due to the trailing spaces being concatenated in the links (see attached image).

This issue does not effect the file share as files/folders are given numerical references.

Revision history for this message
Scott William Gage (scott-gage) wrote :
Revision history for this message
Scott William Gage (scott-gage) wrote :

This issue occurred in Mahara 1.4.0

Changed in mahara:
status: New → Triaged
importance: Undecided → Low
milestone: none → 1.5.0
Revision history for this message
François Marier (fmarier) wrote :

We should trim folder names before they are created in Mahara to avoid this problem entirely.

Revision history for this message
Melissa Draper (melissa) wrote :

https://reviews.mahara.org/697 has been pushed for this

Changed in mahara:
assignee: nobody → Melissa Draper (melissa)
status: Triaged → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/697
Committed: http://gitorious.org/mahara/mahara/commit/ff3fd0e468c48964ce2e46a229bacda801250f7f
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit ff3fd0e468c48964ce2e46a229bacda801250f7f
Author: Melissa Draper <email address hidden>
Date: Thu Sep 15 17:48:10 2011 +1200

    Trim directory names before they are made (bug #813905)

    There are several places in the code where we make directories
    for stuff, both in the filesystem and in the artefacts table.
    If they have trailing spaces, then this can mess up users html
    exports etc. This patch should make exports safe for existing
    folders with whitespace at the end, and prevent new folders from
    from being made with the problem.

    Change-Id: Ia593f7f773e5ffe91ce74e8a736074b1fe1026b2
    Signed-off-by: Melissa Draper <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.