mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Allow *single* dots in page names
This commit is contained in:
parent
35a1161be4
commit
093960133b
4 changed files with 11 additions and 3 deletions
|
@ -497,7 +497,9 @@ function check_subpage_parents($pagename)
|
||||||
*/
|
*/
|
||||||
function makepathsafe($string)
|
function makepathsafe($string)
|
||||||
{
|
{
|
||||||
return preg_replace("/[^0-9a-zA-Z\_\-\ \/]/i", "", $string);
|
$string = preg_replace("/[^0-9a-zA-Z\_\-\ \/\.]/i", "", $string);
|
||||||
|
$string = preg_replace("/\.+/", ".", $string);
|
||||||
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1345,6 +1347,8 @@ register_module([
|
||||||
// Save the pageindex
|
// Save the pageindex
|
||||||
file_put_contents("pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
file_put_contents("pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
||||||
|
|
||||||
|
header("location: ?action=view&page=$new_filename");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
4
core.php
4
core.php
|
@ -213,7 +213,9 @@ function check_subpage_parents($pagename)
|
||||||
*/
|
*/
|
||||||
function makepathsafe($string)
|
function makepathsafe($string)
|
||||||
{
|
{
|
||||||
return preg_replace("/[^0-9a-zA-Z\_\-\ \/]/i", "", $string);
|
$string = preg_replace("/[^0-9a-zA-Z\_\-\ \/\.]/i", "", $string);
|
||||||
|
$string = preg_replace("/\.+/", ".", $string);
|
||||||
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
||||||
"id": "feature-upload",
|
"id": "feature-upload",
|
||||||
"lastupdate": 1445500053,
|
"lastupdate": 1445500347,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -126,6 +126,8 @@ register_module([
|
||||||
// Save the pageindex
|
// Save the pageindex
|
||||||
file_put_contents("pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
file_put_contents("pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
||||||
|
|
||||||
|
header("location: ?action=view&page=$new_filename");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue