fixed issue where numbers are incorrectly stripped from urls

This commit is contained in:
Luke Carlson 2014-06-26 18:00:38 -04:00
bovenliggende 0bae274e3a
commit e14b33a8f4
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen

Bestand weergeven

@ -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);

Bestand weergeven

@ -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 {