Allow unicode characters in page names. Fixes #95.

This commit is contained in:
Starbeamrainbowlabs 2016-08-21 13:12:28 +01:00
parent f6c9ff6101
commit 60b4bbf125
2 changed files with 10 additions and 2 deletions

View File

@ -554,7 +554,11 @@ function check_subpage_parents($pagename)
*/
function makepathsafe($string)
{
$string = preg_replace("/[^0-9a-zA-Z\_\-\ \/\.]/i", "", $string);
// Old restrictive system
//$string = preg_replace("/[^0-9a-zA-Z\_\-\ \/\.]/i", "", $string);
// Remove reserved characters
$string = preg_replace("/[?%*:|\"><()\\[\\]]/i", "", $string);
// Collapse multiple dots into a single dot
$string = preg_replace("/\.+/", ".", $string);
return $string;
}

View File

@ -253,7 +253,11 @@ function check_subpage_parents($pagename)
*/
function makepathsafe($string)
{
$string = preg_replace("/[^0-9a-zA-Z\_\-\ \/\.]/i", "", $string);
// Old restrictive system
//$string = preg_replace("/[^0-9a-zA-Z\_\-\ \/\.]/i", "", $string);
// Remove reserved characters
$string = preg_replace("/[?%*:|\"><()\\[\\]]/i", "", $string);
// Collapse multiple dots into a single dot
$string = preg_replace("/\.+/", ".", $string);
return $string;
}