API debug exception error only returns filename (not file path) when DOCUMENT_ROOT differs from site folder #3267
Labels
type: enhancement ✨
Suggests an enhancement; improves Kirby
Milestone
Describe the bug
In situations where an installation's
$_SERVER['DOCUMENT_ROOT']
is set to a secluded folder that is separate from the Kirby installation (andsite
folder), API exceptions do not return a helpful file path.To Reproduce
Steps to reproduce the behavior:
/var/www/html/website/public
/var/www/html/website/site/plugins/example-plugin/index.php
Expected behavior
The JSON API error would say a helpful file path where the error occurred. Instead, you only get the filename.
Actual
Expected
(The expected file path could be truly relative, with something like
../site/plugins/example-plugin/index.php
, but I don't really care much either way.)Kirby Version
3.5.3
Additional context
Relavant Kirby line:
kirby/src/Api/Api.php
Line 689 in 38afb2d
It seems that
F:: relativepath()
handles the scenario that$file
is not a descendant of$in
by just returning the filename, which seems like an odd choice to me.kirby/src/Toolkit/F.php
Lines 646 to 661 in 38afb2d
The text was updated successfully, but these errors were encountered: