View Issue Details

IDProjectCategoryView StatusLast Update
0037313mantisbtinstallationpublic2026-07-18 12:32
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037313: Invalid default $g_path when running from CLI
Description

The set_default_path() function relies on $_SERVER['SCRIPT_NAME'], which does not contain an URL when running from CLI.

This results in a (most likely) invalid URL being stored in $g_path, which could lead to unexpected behavior or errors later on.

We should not initialize $g_path in this scenario, and rely on the admin defining it in config_inc.php.

Additional Information

While running some tests on a Windows PC that had an incomplete wiki configuration, wiki_init() choked when feeding $g_path http://localhostC:\path\to\mantis/

DEPRECATED: 'Automatic conversion of false to array is deprecated' in '/Users/dregad/dev/mantisbt/mantis/core/wiki_api.php' line 54

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 30ed1ea3

2026-07-18 06:07

dregad


Details Diff
Do not set default $g_path from CLI

The set_default_path() function relies on $_SERVER['SCRIPT_NAME'], which
does not contain an URL when running from CLI.

This results in a most likely invalid URL being stored in $g_path, which
could lead to unexpected behavior or errors later on.

Simply refuse to set $g_path in this case, and print a warning on
screen. Note that this should normally not happen, except in development
environments.

Fixes 0037313
Affected Issues
0037313
mod - core.php Diff File

MantisBT: master 4eba3290

2026-07-18 12:24

dregad


Details Diff
Remove Warning echoed in set_default_path()

This caused the PHPUnit tests to fail.

Fixing regression from 30ed1ea36df25114daae6e45726ff47c4d6f45e8.
Affected Issues
0037313
mod - core.php Diff File