[core] attempt to figure out base href from SCRIPT_FILENAME + DOCUMENT_ROOT, see #1024
This commit is contained in:
parent
db902d6d26
commit
e9c8e852a5
1 changed files with 3 additions and 0 deletions
|
@ -314,6 +314,9 @@ function get_base_href(): string
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(empty($ok_var) && isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['DOCUMENT_ROOT'])) {
|
||||||
|
$ok_var = substr($_SERVER['SCRIPT_FILENAME'], strlen($_SERVER['DOCUMENT_ROOT']));
|
||||||
|
}
|
||||||
assert(!empty($ok_var));
|
assert(!empty($ok_var));
|
||||||
$dir = dirname($ok_var);
|
$dir = dirname($ok_var);
|
||||||
$dir = str_replace("\\", "/", $dir);
|
$dir = str_replace("\\", "/", $dir);
|
||||||
|
|
Reference in a new issue