Bug fixed, base url
This commit is contained in:
parent
9123603d41
commit
7dba06e473
|
@ -34,8 +34,9 @@ define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
|
||||||
define('DOMAIN', $_SERVER['HTTP_HOST']);
|
define('DOMAIN', $_SERVER['HTTP_HOST']);
|
||||||
|
|
||||||
// HTML PATHs
|
// HTML PATHs
|
||||||
$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
//$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||||
$base = dirname($base);
|
//$base = dirname($base);
|
||||||
|
$base = empty($_SERVER['REQUEST_URI']) ? dirname($_SERVER['SCRIPT_NAME']) : dirname($_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
if($base!=DS) {
|
if($base!=DS) {
|
||||||
$base = $base.'/';
|
$base = $base.'/';
|
||||||
|
|
|
@ -153,12 +153,23 @@ $Url = new Url();
|
||||||
$Parsedown = new ParsedownExtra();
|
$Parsedown = new ParsedownExtra();
|
||||||
$Security = new Security();
|
$Security = new Security();
|
||||||
|
|
||||||
// HTML PATHs
|
// HTML PATHS
|
||||||
$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
// The user can define the base URL.
|
||||||
$base = dirname($base);
|
// Left empty if you want to Bludit try to detect the base URL.
|
||||||
|
$base = '';
|
||||||
|
|
||||||
|
if( !empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['SCRIPT_NAME']) && empty($base) ) {
|
||||||
|
$base = str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_NAME']);
|
||||||
|
$base = dirname($base);
|
||||||
|
}
|
||||||
|
elseif( empty($base) ) {
|
||||||
|
$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||||
|
$base = dirname($base);
|
||||||
|
}
|
||||||
|
|
||||||
if($base!=DS) {
|
if($base!=DS) {
|
||||||
$base = $base.'/';
|
$base = trim($base, '/');
|
||||||
|
$base = '/'.$base.'/';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Workaround for Windows Web Servers
|
// Workaround for Windows Web Servers
|
||||||
|
|
Loading…
Reference in New Issue