diff --git a/build/index.php b/build/index.php index 178aa4c..540b7a7 100644 --- a/build/index.php +++ b/build/index.php @@ -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; } }); diff --git a/core.php b/core.php index 7fc6bb4..bc1947a 100644 --- a/core.php +++ b/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; } /* diff --git a/module_index.json b/module_index.json index 2a4304a..9e4316c 100644 --- a/module_index.json +++ b/module_index.json @@ -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 }, { diff --git a/modules/feature-upload.php b/modules/feature-upload.php index cce35af..fdae758 100644 --- a/modules/feature-upload.php +++ b/modules/feature-upload.php @@ -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; } });