mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +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)
|
||||
{
|
||||
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
|
||||
file_put_contents("pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
||||
|
||||
header("location: ?action=view&page=$new_filename");
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
4
core.php
4
core.php
|
@ -213,7 +213,9 @@ function check_subpage_parents($pagename)
|
|||
*/
|
||||
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",
|
||||
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
||||
"id": "feature-upload",
|
||||
"lastupdate": 1445500053,
|
||||
"lastupdate": 1445500347,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -126,6 +126,8 @@ register_module([
|
|||
// Save the pageindex
|
||||
file_put_contents("pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
|
||||
|
||||
header("location: ?action=view&page=$new_filename");
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue