View Issue Details

This issue affects 2 person(s).
 12
IDProjectCategoryView StatusLast Update
20677Bug reportsQuestion editorpublic2026-10-22 11:04
Reporterebubekir42 Assigned Toc_schmitz  
PrioritynoneSeveritytext 
Status resolvedResolutionfixed 
Summary20677: Incorrect image path generated for question background images on Windows Server 2025 with WampServer
Description

When using LimeSurvey with Apache2 on Ubuntu 22.04, images added as a question background image are displayed correctly.

However, when the same functionality is used on Windows Server 2025 with WampServer, LimeSurvey generates an incorrect image URL. The Windows directory separators (\) appear to be encoded as %5C in the generated src attribute.

On Ubuntu 22.04, the generated HTML is:

<img class="w-100 h-auto d-block" src="/upload/surveys/487689/images/test.png" alt="" data-testid="question-image" style="border-radius: 0px; filter: brightness(1);">

On Windows Server 2025 with WampServer, the generated HTML is:

<img class="w-100 h-auto d-block" src="%5Cupload/surveys/967683%5Cimages%5Ctest.png" alt="" data-testid="question-image" style="border-radius: 0px; filter: brightness(1);">

The %5C value represents a backslash (\). Since backslashes are being used in the generated URL and then URL-encoded, the browser cannot correctly resolve the image path, and the image is not displayed.

This appears to be related to path separator handling on Windows. LimeSurvey may be using Windows filesystem path separators (\) when generating a URL, instead of converting them to URL-compatible forward slashes (/).

The issue does not occur in the Ubuntu 22.04 + Apache2 environment, where the image URL is generated correctly with forward slashes.

Steps To Reproduce

Steps to reproduce

  1. Install LimeSurvey on Ubuntu 22.04 using Apache2.
  2. Create a new survey.
  3. Add a question to the survey.
  4. Add an image to the question text and configure it to be used as a question background image.
  5. Inspect the generated HTML and verify that the image URL is generated correctly, for example:
    /upload/surveys/487689/images/test.png
  6. Repeat the same process on Windows Server 2025 using WampServer.
  7. Add an image to the question text and configure it to be used as a question background image.
  8. Inspect the generated HTML.
  9. The image URL is generated with encoded backslashes, for example:
    %5Cupload/surveys/967683%5Cimages%5Ctest.png
  10. As a result, the image is not displayed in the question.

Expected result

LimeSurvey should generate a web-compatible URL for the image regardless of the operating system or web server environment.

On Windows, the generated URL should use forward slashes (/), for example:

/upload/surveys/967683/images/test.png

The image should then be loaded and displayed correctly.

Actual result

On Windows Server 2025 with WampServer, LimeSurvey generates an image URL containing Windows backslashes (\), which are subsequently URL-encoded as %5C.

The generated URL looks like:

%5Cupload/surveys/967683%5Cimages%5Ctest.png

Because this is not a valid/usable web path for the image, the browser cannot load the image and the question background image is not displayed.

The same functionality works correctly on Ubuntu 22.04 with Apache2.

TagsNo tags attached.
Attached Files
Adsız.png (5,016 bytes)   
Adsız.png (5,016 bytes)   
Bug heat12
Complete LimeSurvey version number (& build)7.0.14
I will donate to the project if issue is resolvedNo
BrowserMicrosoft Edge
Database type & versionMySQL 9.7.2
Server OS (if known)Windows Server 2025
Webserver software & version (if known)WampServer 3.4.2
PHP Version9.7.2
Git branch / Pull Request URLhttps://github.com/LimeSurvey/LimeSurvey/pull/5283

Users monitoring this issue

There are no users monitoring this issue.

Activities

DHSUbk

DHSUbk

2026-09-18 08:08

reporter   ~85837

Just found this bug-report, I can confirm that this issue also exists with IIS Webserver as it might be OS related.

DHSUbk

DHSUbk

2026-09-18 16:59

reporter   ~85841

@ebubekir42 the code-change is working for me on IIS. maybe you can review on your end as well?

ebubekir42

ebubekir42

2026-10-05 20:50

reporter   ~86201

Thank you for confirming.

I will review and test the code change on my end as well. In my environment, LimeSurvey is running on Windows with WampServer.

The code change should be made in the following file:

application/helpers/SurveyThemeHelper.php

I will test the change on my WampServer environment and update this issue with the results.

ebubekir42

ebubekir42

2026-10-05 20:50

reporter   ~86202

I tested the code change in application/helpers/SurveyThemeHelper.php on my Windows/WampServer environment, but unfortunately, it did not resolve the issue on my side.

The issue still occurs with the same incorrect path format.

DHSUbk

DHSUbk

2026-10-16 14:59

reporter   ~86501

@ebubekir42 I'm also interested in this fix as I'm running it on IIS, I'm having the same issue. Based on your comments, I'm not sure if you tested the fixed file from c_schmitz properly.

As I mentioned, it is working on my end (IIS environment).

Here are the steps how I tested it:

  1. Download the fixed filed from here: https://github.com/LimeSurvey/LimeSurvey/pull/5283/files (on the right side, click the 3 dots menu to view complete file and download it)
  2. Replace it with the existing file in your installation (application/models/services/FileUploadService.php)
  3. Test the behaviour with the image

On my end it is working fine after i replaced this file. I can now use images as answers in questions as well as images as background images in surveys.

c_schmitz

c_schmitz

2026-10-22 11:04

administrator   ~86697

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

Related Changesets

LimeSurvey: master 6041895a

2026-10-22 11:04

c_schmitz

Committer: GitHub


Details Diff
Fixed issue 20677: Incorrect image path generated for question background images on Windows server (05283) Affected Issues
20677
mod - application/models/services/FileUploadService.php Diff File

Issue History

Date Modified Username Field Change
2026-09-08 19:19 ebubekir42 New Issue
2026-09-08 19:19 ebubekir42 File Added: Adsız.png
2026-09-09 08:19 c_schmitz Assigned To => c_schmitz
2026-09-09 08:19 c_schmitz Status new => assigned
2026-09-09 08:19 c_schmitz Status assigned => ready for code review
2026-09-09 08:20 c_schmitz Git branch / Pull Request URL => https://github.com/LimeSurvey/LimeSurvey/pull/5283
2026-09-18 08:07 guest Bug heat 0 => 6
2026-09-18 08:08 DHSUbk Note Added: 85837
2026-09-18 08:08 DHSUbk Bug heat 6 => 8
2026-09-18 16:59 DHSUbk Note Added: 85841
2026-10-05 20:50 ebubekir42 Note Added: 86201
2026-10-05 20:50 ebubekir42 Bug heat 8 => 10
2026-10-05 20:50 ebubekir42 Note Added: 86202
2026-10-16 14:59 DHSUbk Note Added: 86501
2026-10-22 11:04 c_schmitz Changeset attached => LimeSurvey master 6041895a
2026-10-22 11:04 c_schmitz Note Added: 86697
2026-10-22 11:04 c_schmitz Status ready for code review => resolved
2026-10-22 11:04 c_schmitz Resolution open => fixed
2026-10-22 11:04 c_schmitz Bug heat 10 => 12