From 0b94955297279f73d732c6553400db0145221c57 Mon Sep 17 00:00:00 2001 From: Bedder Date: Mon, 9 Nov 2015 04:37:51 -0600 Subject: [PATCH 1/4] Changing parameters Path values of the constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Las constantes HTML_PATH_ROOT y PATH_THEME están defectuosas; producen un error que no permite visualizar con normalidad el home y la página de administración. Para reproducir el error, utilizar Windows como servidor y crear un subdominio. Ej.: bludit.example.net --- kernel/boot/init.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/kernel/boot/init.php b/kernel/boot/init.php index e9471d91..30b24324 100644 --- a/kernel/boot/init.php +++ b/kernel/boot/init.php @@ -146,16 +146,8 @@ $Url = new Url(); $Parsedown = new Parsedown(); $Security = new Security(); -// HTML PATHs -//$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/'; -$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; -$base = dirname($base); - -if($base!=DS) { - $base = $base.'/'; -} - -define('HTML_PATH_ROOT', $base); +// Relative path logic +define('HTML_PATH_ROOT', '/'); // Paths for themes define('HTML_PATH_THEMES', HTML_PATH_ROOT.'themes/'); @@ -173,7 +165,7 @@ define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/'); define('JQUERY', HTML_PATH_ADMIN_THEME_JS.'jquery.min.js'); // PHP paths with dependency -define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/'); +define('PATH_THEME', PATH_ROOT.'themes'.DS.$Site->theme().DS); define('PATH_THEME_PHP', PATH_THEME.'php'.DS); define('PATH_THEME_CSS', PATH_THEME.'css'.DS); define('PATH_THEME_JS', PATH_THEME.'js'.DS); From 02fef47025c61021228520cd11a16c48cfa99564 Mon Sep 17 00:00:00 2001 From: Bedder Date: Fri, 13 Nov 2015 07:10:50 -0600 Subject: [PATCH 2/4] Update init.php --- kernel/boot/init.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/boot/init.php b/kernel/boot/init.php index 30b24324..315bb3f1 100644 --- a/kernel/boot/init.php +++ b/kernel/boot/init.php @@ -146,7 +146,19 @@ $Url = new Url(); $Parsedown = new Parsedown(); $Security = new Security(); -// Relative path logic +// HTML PATHs +//$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/'; +$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; +$base = dirname($base); + +if($base!=DS) { + $base = $base.'/'; +} + +if (dirname($_SERVER['SCRIPT_NAME']) == '\\') { + $base = '/'; +} + define('HTML_PATH_ROOT', '/'); // Paths for themes From c31cd5f200b7322dadb08581389b41a37411d71d Mon Sep 17 00:00:00 2001 From: Bedder Date: Fri, 13 Nov 2015 07:11:25 -0600 Subject: [PATCH 3/4] Update init.php --- kernel/boot/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/boot/init.php b/kernel/boot/init.php index 315bb3f1..7cdf9b73 100644 --- a/kernel/boot/init.php +++ b/kernel/boot/init.php @@ -159,7 +159,7 @@ if (dirname($_SERVER['SCRIPT_NAME']) == '\\') { $base = '/'; } -define('HTML_PATH_ROOT', '/'); +define('HTML_PATH_ROOT', $base); // Paths for themes define('HTML_PATH_THEMES', HTML_PATH_ROOT.'themes/'); From 73395b1bc147fd2aa940e8ea4ffdd396dfa68e1f Mon Sep 17 00:00:00 2001 From: Bedder Date: Fri, 13 Nov 2015 17:38:41 -0600 Subject: [PATCH 4/4] Update init.php --- kernel/boot/init.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/boot/init.php b/kernel/boot/init.php index 7cdf9b73..815bd18a 100644 --- a/kernel/boot/init.php +++ b/kernel/boot/init.php @@ -152,11 +152,9 @@ $base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRI $base = dirname($base); if($base!=DS) { - $base = $base.'/'; -} - -if (dirname($_SERVER['SCRIPT_NAME']) == '\\') { - $base = '/'; + $base = $base.'/'; +}else{ // work in subdomain + $base = '/'; } define('HTML_PATH_ROOT', $base);