Daniel-KM / Omeka-S-module-ArchiveRepertory

Omeka S module that allows to keep original names of files and to put them in a hierarchical structure (collection / item / files) in order to get readable urls for files and to avoid an overloading of the file server.
Other
2 stars 3 forks source link

Filenames are converted even when using utf8 compatible server. Error in parenthesis. #3

Closed hydrosIII closed 6 months ago

hydrosIII commented 6 years ago

Hi. Currently I have an issue with this. It is a small error, but currently the plugin is turning all ( characters into [, and ) into ]. Thus modifying the names of the images.

Thanks.

Daniel-KM commented 6 years ago

This is not a bug, but a feature. It may avoid some securities issues.

If you want to keep "(" and ")", you can remove them in two lines https://github.com/Daniel-KM/Omeka-S-module-ArchiveRepertory/blob/master/src/File/FileManager.php#L466:

        $string = preg_replace('/[\{]/', '[', $string);
        $string = preg_replace('/[\}]/', ']', $string);

or simpler:

        $string = str_replace('{', '[', $string);
        $string = str_replace('}', ']', $string);
hydrosIII commented 6 years ago

Thanks.