From e14b33a8f497c625df56e29a7143aac2959237d1 Mon Sep 17 00:00:00 2001 From: Luke Carlson Date: Thu, 26 Jun 2014 18:00:38 -0400 Subject: [PATCH] fixed issue where numbers are incorrectly stripped from urls --- libs/functions.php | 4 ++-- libs/live.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/functions.php b/libs/functions.php index 76d7f97..25eaf0d 100755 --- a/libs/functions.php +++ b/libs/functions.php @@ -203,7 +203,7 @@ } // File to URL - function clean_url($url, $mode = 'Static') { + function clean_url($url, $mode = 'Static', $from_link=false) { global $docs_path, $output_path, $options; switch ($mode) { case 'Live': @@ -216,7 +216,7 @@ $url = explode('/', $url); foreach ($url as &$a) { $a = explode('_', $a); - if (isset($a[0]) && is_numeric($a[0])) unset($a[0]); + if (isset($a[0]) && is_numeric($a[0]) && !$from_link) unset($a[0]); $a = implode('_', $a); } $url = implode('/', $url); diff --git a/libs/live.php b/libs/live.php index 0cc0e9a..52a956c 100644 --- a/libs/live.php +++ b/libs/live.php @@ -27,7 +27,7 @@ // Get File from $url function getfile($tree, $url, $current_dir, $flag = FALSE) { global $docs_path, $base_doc, $options; - $url = clean_url($url, "Live"); + $url = clean_url($url, "Live", true); if ($url === '' || $url === 'index') { if (is_file($docs_path . "/index.md")) return $docs_path . "/index.md"; else {