fixed issue where numbers are incorrectly stripped from urls
This commit is contained in:
parent
0bae274e3a
commit
e14b33a8f4
@ -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);
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user