selfoss
selfoss copied to clipboard
Confusing error message when non-absolute base_url is set
2.19-fd8f195 doesn't work here. In the selfoss-logfile only the following Message appears: [2021-09-01 17:16:35] selfoss.ERROR: Undefined index: scheme
While running "php cliupdate.php" the following essages appear in the console:
Undefined index: scheme
[src/helpers/Authentication.php:39] Base->{closure}()
[vendor/level-2/dice/Dice.php:95] ReflectionMethod->invokeArgs()
[vendor/level-2/dice/Dice.php:69] Dice\Dice->Dice{closure}()
[vendor/level-2/dice/Dice.php:182] Dice\Dice->create()
[vendor/level-2/dice/Dice.php:95] Dice\Dice->Dice{closure}()
[vendor/level-2/dice/Dice.php:69] Dice\Dice->Dice{closure}()
[vendor/level-2/dice/Dice.php:182] Dice\Dice->create()
[vendor/level-2/dice/Dice.php:100] Dice\Dice->Dice{closure}()
[vendor/level-2/dice/Dice.php:69] Dice\Dice->Dice{closure}()
[src/common.php:198] Dice\Dice->create()
[cliupdate.php:6] {closure}()
An error occured, please check the log file “[...]/data/logs/default.log”.
This messages appear in the webserver-logfile too, when I try to open selfoss in the browser.
Currently I am using selfoss 2.19-3e93a10, this works fine.
Thanks for reporting. Do you by chance have base_url
defined in your config.ini
? Apparently, it currently does not seem to handle non-absolute URLs correctly:
https://github.com/fossar/selfoss/blob/fd8f19515b5ec7ac18aa2465ab707727f0e06c89/src/helpers/View.php#L38-L45
This seems to be the problem, with base_url empty or set correcly it works. Thank you.
I think we need to at least add a check to warn when the URL is not absolute.