From f013ff0ed289317d328c4ae5df3e4db3c6f7d06a Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Fri, 9 Jul 2010 18:39:52 -0700 Subject: [PATCH] index file recognizes endings on pages --- public/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/index.php b/public/index.php index e8b9d9f..ba03ff2 100644 --- a/public/index.php +++ b/public/index.php @@ -10,7 +10,7 @@ $t = get_template_instance(); $t->response_format = $response_format; $t->assign('view', $_GET['v']); - + # is folder if (is_dir(LOCAL_ROOT . CONTENT_DIR . $url_parts['url']) && $url_parts['url'] != "/") { list($data, $total) = get_entries($url_parts['url']); @@ -24,8 +24,8 @@ $template = 'single.'.$response_format.'.tpl'; } # is page - else if (is_file( LOCAL_ROOT . PAGE_DIR . $url_parts['url'])) { - $page = parse_entry(new SplFileInfo(LOCAL_ROOT . PAGE_DIR . $url_parts['url']), 1); + else if (is_file( LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $url_parts['filename'])) { + $page = parse_entry(new SplFileInfo(LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $url_parts['filename']), 1); $t->assign('data', $page); $template = $page['config']['template'] ? $page['config']['template'] . '.' . $response_format . '.tpl' : 'page.' . $response_format . '.tpl'; } -- 2.34.1