View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18353Bug reportsImport/Exportpublic2022-09-30 14:37
ReporterEmilieClx Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version5.3.x 
Summary18353: Unable to upload an xml file
Description

As described on the French forum in the topic https://forums.limesurvey.org/forum/french-forum/128133-difficult%C3%A9s-avec-une-question-de-type-t%C3%A9l%C3%A9chargement, I read the doc manual.limesurvey.org/Questiontype-_File_upload.
I created a question upload where the allowed filetype is xml. I added it in the config file for the variable allowedfileuploads.
The upload is allowed in php.ini and php-fpm
I restarted nginx.
When I want to upload a file of type xml, I have the error "Sorry, impossible to validate the extension for the file type text/xml.".
We added the line 'text/xml'=>'xml', to the file application/core/utils/fileExtensions.php
The download is now possible. It seems that text/xml is not the official mimetype of xml : github.com/LimeSurvey/LimeSurvey/blob/32...eExtensions.php#L593
Thanks in advance for fixing this bug.

Steps To Reproduce

Steps to reproduce

I created a question upload where the allowed filetype is xml.
I added it in the config file for the variable allowedfileuploads. The upload is allowed in php.ini and php-fpm
I restarted nginx.
I try to upload a file of type xml
I have the error "Sorry, impossible to validate the extension for the file type text/xml."
We added the line 'text/xml'=>'xml', to the file application/core/utils/fileExtensions.php
The download is now possible.

Expected result

upload an xml file

Actual result

The download is now possible but it seems that text/xml is not the official mimetype of xml : github.com/LimeSurvey/LimeSurvey/blob/32...eExtensions.php#L593

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)LimeSurvey Community Edition Version 5.3.26+220720
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL
Server OS (if known)Your own server or LimeSurvey Cloud: debian 5.10.0-16-amd64 x86_64
Webserver software & version (if known)
PHP Version7.4

Relationships

related to 18347 resolvedDenisChenu Unable to check extension of this file type image/svg. 

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-09-19 10:39

developer   ~71811

Valid xml shown as text/xml in last debian :)

note.xml (164 bytes)   
<?xml version="1.0" encoding="UTF-8"?>
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
note.xml (164 bytes)   
DenisChenu

DenisChenu

2022-09-19 10:55

developer   ~71812

master : https://github.com/LimeSurvey/LimeSurvey/pull/2613

gabrieljenik

gabrieljenik

2022-09-26 17:47

manager   ~71948

I think @ollehar is not inclined for allowing XML uploads... am I right?

DenisChenu

DenisChenu

2022-09-26 17:53

developer   ~71949

It's not the point here.

If you allow xml (via config.php) : application/xml is OK but not text/xml

See : https://github.com/LimeSurvey/LimeSurvey/blob/f85766ed01ea46f0798499e717602023809b81b3/third_party/yiisoft/yii/framework/utils/fileExtensions.php#L593

I just set text/xml as xml file.

DenisChenu

DenisChenu

2022-09-30 14:04

developer   ~72029

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=33922

Related Changesets

LimeSurvey: master 0452b58f

2022-09-30 14:04:44

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18353: Unable to upload an xml file (#2613)

* Dev: Code sniffer

* Fixed issue 18353: Unable to upload an xml file

* Fixed issue 18347: Unable to check extension of this file type image/svg.
Affected Issues
18347, 18353
mod - application/core/utils/fileExtensions.php Diff File

Issue History

Date Modified Username Field Change
2022-09-15 12:40 EmilieClx New Issue
2022-09-15 12:54 DenisChenu Assigned To => DenisChenu
2022-09-15 12:54 DenisChenu Status new => assigned
2022-09-15 12:57 DenisChenu Relationship added related to 18347
2022-09-19 10:39 DenisChenu Note Added: 71811
2022-09-19 10:39 DenisChenu File Added: note.xml
2022-09-19 10:39 DenisChenu Bug heat 0 => 2
2022-09-19 10:54 DenisChenu Assigned To DenisChenu =>
2022-09-19 10:54 DenisChenu Status assigned => ready for code review
2022-09-19 10:55 DenisChenu Additional Information Updated
2022-09-19 10:55 DenisChenu Additional Information Updated
2022-09-19 10:55 DenisChenu Note Added: 71812
2022-09-26 17:47 gabrieljenik Note Added: 71948
2022-09-26 17:47 gabrieljenik Bug heat 2 => 4
2022-09-26 17:53 DenisChenu Note Added: 71949
2022-09-26 17:54 DenisChenu Assigned To => gabrieljenik
2022-09-26 20:30 gabrieljenik Assigned To gabrieljenik => DenisChenu
2022-09-26 20:30 gabrieljenik Status ready for code review => ready for testing
2022-09-27 10:40 DenisChenu Status ready for testing => ready for merge
2022-09-29 09:27 DenisChenu Priority none => normal
2022-09-29 09:28 DenisChenu Assigned To DenisChenu =>
2022-09-30 11:27 pstelling Assigned To => pstelling
2022-09-30 11:28 pstelling Status ready for merge => in testing
2022-09-30 14:04 DenisChenu Changeset attached => LimeSurvey master 0452b58f
2022-09-30 14:04 DenisChenu Note Added: 72029
2022-09-30 14:04 DenisChenu Assigned To pstelling => DenisChenu
2022-09-30 14:04 DenisChenu Resolution open => fixed
2022-09-30 14:37 pstelling Status in testing => resolved