Commit 5c3ee552 authored by mikeytown2's avatar mikeytown2

Issue #1878454 by mikeytown2: Fix httprl_build_url_self when called from the command line.

parent 4ea09e6c
......@@ -211,6 +211,16 @@ function httprl_build_url_self($path = '', $detect_schema = FALSE) {
}
}
// Fix root_path.
// With dirname() if there are no slashes in the path, a dot is returned,
if ($root_path == '/./') {
$root_path = '/';
}
// If ran from the command line SCRIPT_NAME contains the working directory.
elseif (!empty($_SERVER['PWD'])) {
$root_path = str_replace($_SERVER['PWD'] . '/', '', $root_path);
}
// Server auth.
$auth = '';
if (isset($_SERVER['AUTH_TYPE']) && $_SERVER['AUTH_TYPE'] == 'Basic') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment