From d59bbb3831346783485d24083cca568fc361cbd3 Mon Sep 17 00:00:00 2001 From: Arthur Halet Date: Tue, 8 Jul 2014 18:33:30 +0200 Subject: [PATCH] +Add compatibility with file with accent --- libs/functions.php | 5 +++-- libs/live.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/functions.php b/libs/functions.php index 25eaf0d..69e1cef 100755 --- a/libs/functions.php +++ b/libs/functions.php @@ -81,6 +81,7 @@ $tree = array(); $Item = array_diff(scandir($dir), array(".", "..")); foreach ($Item as $key => $value) { + $value = utf8_encode($value); if (is_dir($dir . '/' . $value)) { if (!in_array($value, $ignore['folders'])) $tree[$value] = directory_tree($dir . '/' . $value, $ignore); @@ -169,9 +170,9 @@ $page['content'] = $Parsedown->text($page['markdown']); if ($options['breadcrumbs']) { - $page['title'] = url_to_title(get_url($file), 'Colons'); + $page['title'] = utf8_encode(url_to_title(get_url($file), 'Colons')); } else { - $page['title'] = clean_url($file, 'Title'); + $page['title'] = utf8_encode(clean_url($file, 'Title')); } } $relative_base = ($mode === 'Static') ? relative_path("", $file) : "http://" . $base_path . '/'; diff --git a/libs/live.php b/libs/live.php index 3261524..99184ef 100644 --- a/libs/live.php +++ b/libs/live.php @@ -7,7 +7,7 @@ $b = explode('/', clean_url($page, "Live")); $output_language = $b[0]; } - $file = clean_url_to_file($page); + $file = utf8_decode(clean_url_to_file($page)); if (!is_file($file)) $file = FALSE; return generate_page($file); }