Moodle

Files accidentally uploaded with apostrophes in the filename can't be deleted.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.8.9, 1.9.5
  • Component/s: General
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Files accidentally uploaded with apostrophes in the filename can't be deleted.

Perhaps this is a problem with our server and not a Moodle problem.
However, I thought it would be a good idea to report the problem.

Issue Links

Activity

Hide
Mathieu Petit-Clair added a comment -

Can you give us some information about your server, OS and database? Some details on how to reproduce the bug would be appreciated as well.

Thanks,

Show
Mathieu Petit-Clair added a comment - Can you give us some information about your server, OS and database? Some details on how to reproduce the bug would be appreciated as well. Thanks,
Hide
Petr Škoda (skodak) added a comment -

This is a known issue - the problem is in sanitisation of file names in file manager. I do not think it would be wise to relax the checks there, instead we might add a new button that fixes all file names in directory.

Show
Petr Škoda (skodak) added a comment - This is a known issue - the problem is in sanitisation of file names in file manager. I do not think it would be wise to relax the checks there, instead we might add a new button that fixes all file names in directory.
Hide
Petr Škoda (skodak) added a comment -

Steps to reproduce are:
1/ select info-zip binary for unzipping in site config
2/ pack files with special chars in names
3/ upload and unzip in Moodle UI

There might be some other buggy places that do not filter file/directory names - those should be fixed if found.

Show
Petr Škoda (skodak) added a comment - Steps to reproduce are: 1/ select info-zip binary for unzipping in site config 2/ pack files with special chars in names 3/ upload and unzip in Moodle UI There might be some other buggy places that do not filter file/directory names - those should be fixed if found.
Hide
Petr Škoda (skodak) added a comment -

my +1 to revert the last commit - it might cause regressions in stable branch; instead you could use file exists before calling the delete function

Show
Petr Škoda (skodak) added a comment - my +1 to revert the last commit - it might cause regressions in stable branch; instead you could use file exists before calling the delete function
Hide
Mathieu Petit-Clair added a comment -

Following discussion with Petr (who commented here before I had the time to mention the commits I did!), I reverted the commits.

I just can't bring myself to like the idea of adding a button to "clean up" file names. This is just making it worse, and fulldelete() would still fail silently when the file contain "wrong" characters.

Show
Mathieu Petit-Clair added a comment - Following discussion with Petr (who commented here before I had the time to mention the commits I did!), I reverted the commits. I just can't bring myself to like the idea of adding a button to "clean up" file names. This is just making it worse, and fulldelete() would still fail silently when the file contain "wrong" characters.
Hide
Petr Škoda (skodak) added a comment -

I already proposed a different solution in the dev chat

Show
Petr Škoda (skodak) added a comment - I already proposed a different solution in the dev chat
Hide
Petr Škoda (skodak) added a comment -

fixed in head already

Show
Petr Škoda (skodak) added a comment - fixed in head already
Hide
Petr Škoda (skodak) added a comment -

you can not upload such files any more

Show
Petr Škoda (skodak) added a comment - you can not upload such files any more
Hide
Sam Hemelryk added a comment -

Confirmed commas replaced by underscores. Thanks

Show
Sam Hemelryk added a comment - Confirmed commas replaced by underscores. Thanks

People

Dates

  • Created:
    Updated:
    Resolved: