I think line 185 is responsible for this, not 186.
$script_uri = UBUtil::array_fetch($server_global, 'SCRIPT_URI');
The constant SCRIPT_URI within the server globals will not always be defined. This appears to come from Apache’s “mod_rewrite”, and it contains a fully absolute URL for the script path. I don’t think that PHP running in FCGI or FPM environments will have this, therefore instead of SCRIPT_URI I think adding this between lines 185 and 186 will do the same:
if (null === $script_uri) {
$script_uri = sprintf(
"%s://%s%s",
UBUtil::array_fetch($server_global, 'REQUEST_SCHEME'),
UBUtil::array_fetch($server_global, 'HTTP_HOST'),
UBUtil::array_fetch($server_global, 'REQUEST_URI'),
);
}
That’ll give you an absolute URL, e.g. “https://example.com/whatever/page/”.
-
This reply was modified 8 months, 1 week ago by adamreecewebbox. Reason: HTML character encoding