From 254476c94cf196b2e339785fb1ea7b5b7a2a56ad Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Sat, 2 Apr 2016 21:21:34 +0100
Subject: [PATCH] Bump version module version numbers again, and fix critical
 issue with new expanded upload capabilities

---
 build/index.php                    | 11 ++++++++---
 module_index.json                  | 12 ++++++------
 modules/feature-recent-changes.php |  2 +-
 modules/feature-upload.php         |  2 +-
 modules/page-move.php              |  7 ++++++-
 5 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/build/index.php b/build/index.php
index c104c03..1d272c8 100644
--- a/build/index.php
+++ b/build/index.php
@@ -1563,7 +1563,7 @@ function render_sidebar($pageindex, $root_pagename = "")
 
 register_module([
 	"name" => "Recent Changes",
-	"version" => "0.2.0",
+	"version" => "0.2.1",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Adds recent changes. Access through the 'recent-changes' action.",
 	"id" => "feature-recent-changes",
@@ -2229,7 +2229,7 @@ class search
 
 register_module([
 	"name" => "Uploader",
-	"version" => "0.3",
+	"version" => "0.4",
 	"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",
@@ -3502,7 +3502,7 @@ register_module([
 
 register_module([
 	"name" => "Page mover",
-	"version" => "0.8",
+	"version" => "0.8.1",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Adds an action to allow administrators to move pages.",
 	"id" => "page-move",
@@ -3556,6 +3556,11 @@ register_module([
 				<p>It is possible that you tried to use some characters in the new name that are not allowed and were removed.</p>
 				<p>Page names may only contain alphanumeric characters, dashes, and underscores.</p>"));
 			
+			if(isset($pageindex->$page->uploadedfile) and
+				file_exists($new_name))
+				exit(page_renderer::render_main("Moving $env->page - Error - $settings->sitename", "<p>Whilst moving the file associated with $env->page, $settings->sitename detected a pre-existing file on the server's file system. Because $settings->sitename can't determine whether the existing file is important to another component of $settings->sitename or it's host web server, the move have been aborted - just in case.</p>
+				<p>If you know that this move is actually safe, please get your site administrator (" . $settings->admindetails["name"] . ") to perform the move manually. Their contact address can be found at the bottom of every page (including this one).</p>"));
+			
 			//move the page in the page index
 			$pageindex->$new_name = new stdClass();
 			foreach($pageindex->$page as $key => $value)
diff --git a/module_index.json b/module_index.json
index 1142aa4..d1eca48 100644
--- a/module_index.json
+++ b/module_index.json
@@ -37,11 +37,11 @@
     },
     {
         "name": "Recent Changes",
-        "version": "0.2.0",
+        "version": "0.2.1",
         "author": "Starbeamrainbowlabs",
         "description": "Adds recent changes. Access through the 'recent-changes' action.",
         "id": "feature-recent-changes",
-        "lastupdate": 1459601264,
+        "lastupdate": 1459627889,
         "optional": false
     },
     {
@@ -64,11 +64,11 @@
     },
     {
         "name": "Uploader",
-        "version": "0.3",
+        "version": "0.4",
         "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": 1459621957,
+        "lastupdate": 1459627881,
         "optional": false
     },
     {
@@ -154,11 +154,11 @@
     },
     {
         "name": "Page mover",
-        "version": "0.8",
+        "version": "0.8.1",
         "author": "Starbeamrainbowlabs",
         "description": "Adds an action to allow administrators to move pages.",
         "id": "page-move",
-        "lastupdate": 1451134153,
+        "lastupdate": 1459628404,
         "optional": false
     },
     {
diff --git a/modules/feature-recent-changes.php b/modules/feature-recent-changes.php
index d716183..4c5fe43 100644
--- a/modules/feature-recent-changes.php
+++ b/modules/feature-recent-changes.php
@@ -1,7 +1,7 @@
 <?php
 register_module([
 	"name" => "Recent Changes",
-	"version" => "0.2.0",
+	"version" => "0.2.1",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Adds recent changes. Access through the 'recent-changes' action.",
 	"id" => "feature-recent-changes",
diff --git a/modules/feature-upload.php b/modules/feature-upload.php
index e9e9c76..141fa98 100644
--- a/modules/feature-upload.php
+++ b/modules/feature-upload.php
@@ -1,7 +1,7 @@
 <?php
 register_module([
 	"name" => "Uploader",
-	"version" => "0.3",
+	"version" => "0.4",
 	"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",
diff --git a/modules/page-move.php b/modules/page-move.php
index 5064e2b..e3a53de 100644
--- a/modules/page-move.php
+++ b/modules/page-move.php
@@ -1,7 +1,7 @@
 <?php
 register_module([
 	"name" => "Page mover",
-	"version" => "0.8",
+	"version" => "0.8.1",
 	"author" => "Starbeamrainbowlabs",
 	"description" => "Adds an action to allow administrators to move pages.",
 	"id" => "page-move",
@@ -55,6 +55,11 @@ register_module([
 				<p>It is possible that you tried to use some characters in the new name that are not allowed and were removed.</p>
 				<p>Page names may only contain alphanumeric characters, dashes, and underscores.</p>"));
 			
+			if(isset($pageindex->$page->uploadedfile) and
+				file_exists($new_name))
+				exit(page_renderer::render_main("Moving $env->page - Error - $settings->sitename", "<p>Whilst moving the file associated with $env->page, $settings->sitename detected a pre-existing file on the server's file system. Because $settings->sitename can't determine whether the existing file is important to another component of $settings->sitename or it's host web server, the move have been aborted - just in case.</p>
+				<p>If you know that this move is actually safe, please get your site administrator (" . $settings->admindetails["name"] . ") to perform the move manually. Their contact address can be found at the bottom of every page (including this one).</p>"));
+			
 			//move the page in the page index
 			$pageindex->$new_name = new stdClass();
 			foreach($pageindex->$page as $key => $value)
