View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
20059Bug reportsPluginspublic2025-05-02 08:08
ReporterDenisChenu Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version6.6.x 
Summary20059: createAbsoluteUrl don't use publicurl
Description

Using createAbsoluteUrl in plugin are broken even when set publicurl

Steps To Reproduce

Steps to reproduce

Import and activate included plugins
Set publicurl = 'https://example.org' in config.php
Launch php application/commands/console.php plugin index --target=checkCommandUrl
Launch php application/commands/console.php plugin index --target=checkCommandUrlSetHost

Expected result

have valid url in both plugins

Actual result

have invalid url in both plugins

  • with checkCommandUrl SURVEYURL is OK, but not OPTOUTURL
  • with checkCommandUrlSetHost OPTOUTURL is OK, but not SURVEYURL
TagsNo tags attached.
Attached Files
checkCommandUrl.zip (1,505 bytes)
Bug heat4
Complete LimeSurvey version number (& build)6.12.4
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP VersionPHP8.2

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2025-04-14 16:20

developer   ~82425

Real result

$ php8.2 application/commands/console.php plugin index --target=checkCommandUrl
http://application/commands/console.php?r=survey/index&surveyid=123
http://application/commands/console.php?r=optout/tokens&surveyid=&token=abcd
https://example.org/console.php?r=survey/index&sid=489424&lang=en
$ php8.2 application/commands/console.php plugin index --target=checkCommandUrlSetHost
http://limesurtvey.example.com/subdirectory?r=survey/index&surveyid=123
http://limesurtvey.example.com/subdirectory?r=optout/tokens&surveyid=123&token=abcd
https://example.orghttp://limesurtvey.example.com/subdirectory?r=survey/index&sid=489424&lang=en

I don't have opinion if checkCommandUrlSetHost must use publicurl or not.

For checkCommandUrl : broken without error_reporting(0);
PHP Error[2]: Undefined array key "SERVER_NAME"
Must be avoided too

gabrieljenik

gabrieljenik

2025-05-01 15:29

manager   ~82549

We have App()->createPublicUrl() for that. Have you tried it?

DenisChenu

DenisChenu

2025-05-01 20:32

developer   ~82553

Last edited: 2025-05-01 20:32

Maybe but createAbsoluteUrl still broken

gabrieljenik

gabrieljenik

2025-05-01 21:20

manager   ~82554

createAbsoluteUrl is std for Yii.
I believe it is not aware of publicurl (which is something LS related).

DenisChenu

DenisChenu

2025-05-02 08:08

developer   ~82555

I believe it is not aware of publicurl (which is something LS related).

It work in 3.X (and in 5.0)

Issue History

Date Modified Username Field Change
2025-04-14 16:17 DenisChenu New Issue
2025-04-14 16:17 DenisChenu File Added: checkCommandUrl.zip
2025-04-14 16:17 DenisChenu File Added: checkCommandUrlSetHost.zip
2025-04-14 16:20 DenisChenu Note Added: 82425
2025-04-14 16:20 DenisChenu Bug heat 0 => 2
2025-04-24 22:00 tibor.pacalat Assigned To => gabrieljenik
2025-04-24 22:00 tibor.pacalat Status new => assigned
2025-05-01 15:29 gabrieljenik Note Added: 82549
2025-05-01 15:29 gabrieljenik Bug heat 2 => 4
2025-05-01 20:32 DenisChenu Note Added: 82553
2025-05-01 20:32 DenisChenu Note Edited: 82553
2025-05-01 21:20 gabrieljenik Note Added: 82554
2025-05-02 08:08 DenisChenu Note Added: 82555