fixed issue where numbers are incorrectly stripped from urls

This commit is contained in:
Luke Carlson 2014-06-26 18:00:38 -04:00
parent 0bae274e3a
commit e14b33a8f4
2 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@
} }
// File to URL // File to URL
function clean_url($url, $mode = 'Static') { function clean_url($url, $mode = 'Static', $from_link=false) {
global $docs_path, $output_path, $options; global $docs_path, $output_path, $options;
switch ($mode) { switch ($mode) {
case 'Live': case 'Live':
@ -216,7 +216,7 @@
$url = explode('/', $url); $url = explode('/', $url);
foreach ($url as &$a) { foreach ($url as &$a) {
$a = explode('_', $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); $a = implode('_', $a);
} }
$url = implode('/', $url); $url = implode('/', $url);

View File

@ -27,7 +27,7 @@
// Get File from $url // Get File from $url
function getfile($tree, $url, $current_dir, $flag = FALSE) { function getfile($tree, $url, $current_dir, $flag = FALSE) {
global $docs_path, $base_doc, $options; global $docs_path, $base_doc, $options;
$url = clean_url($url, "Live"); $url = clean_url($url, "Live", true);
if ($url === '' || $url === 'index') { if ($url === '' || $url === 'index') {
if (is_file($docs_path . "/index.md")) return $docs_path . "/index.md"; if (is_file($docs_path . "/index.md")) return $docs_path . "/index.md";
else { else {