MantisBT: master 30ed1ea3

Author Committer Branch Timestamp Parent
dregad dregad master 2026-07-18 06:07 master 10193141
Affected Issues  0037313: Invalid default $g_path when running from CLI
Changeset

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

mod - core.php Diff File