From 2a24066d7b21a1e678f2882fc21b9130b9bc9d1a Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Thu, 10 May 2018 23:34:53 +0100
Subject: [PATCH] Update changelog, and make $settings->css keep a value of
 auto

---
 Changelog.md          |  6 ++++++
 build/index.php       | 14 +++++++-------
 core.php              |  4 ++--
 module_index.json     |  2 +-
 settings.fragment.php |  3 ---
 5 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/Changelog.md b/Changelog.md
index 1ca5816..dbb401c 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,6 +1,12 @@
 # Changelog
 This file holds the changelog for Pepperminty Wiki. This is the master list of things that have changed (second only to the commit history!) - though the information for any particular release can also be found in the description of it's page for every release made on GitHub too.
 
+## v0.17-dev
+
+## Changed
+ - Password hashing has been overhauled! A totally new-and-different system is being used now, so you'll need to rehash all your passwords.
+ - The `css` setting will now keep a value of auto, even when `peppermint.json` is automatically updated by _Pepperminty Wiki_.
+
 ## v0.16
 _(No changes since v0.16-beta1)_
 
diff --git a/build/index.php b/build/index.php
index 0c6ee94..90dd723 100644
--- a/build/index.php
+++ b/build/index.php
@@ -379,9 +379,6 @@ summary { cursor: pointer; }
 footer { padding: 2rem; }
 /* #ffdb6d #36962c hsl(36, 78%, 80%) hsl(262, 92%, 68%, 0.42) */
 THEMECSS;
-if($settings->css === "auto")
-	$settings->css = $defaultCSS;
-
 
 
 
@@ -390,7 +387,7 @@ if($settings->css === "auto")
 /////////////////////////////////////////////////////////////////////////////
 /** The version of Pepperminty Wiki currently running. */
 $version = "v0.17-dev";
-$commit = "8010770fd444bb81ba8eb78bd10d8067a715c3c3";
+$commit = "41ea63281c23c29c5730cbad90e7f085c59717e8";
 /// Environment ///
 /** Holds information about the current request environment. */
 $env = new stdClass();
@@ -1654,13 +1651,13 @@ class page_renderer
 	 */
 	public static function get_css_as_html()
 	{
-		global $settings;
+		global $settings, $defaultCSS;
 
 		if(preg_match("/^[^\/]*\/\/|^\//", $settings->css))
 			return "<link rel='stylesheet' href='$settings->css' />\n";
 		else
 		{
-			$css = $settings->css;
+			$css = $settings->css == "auto" ? $defaultCSS : $settings->css;
 			if(!empty($settings->optimize_pages))
 			{
 				// CSS Minification ideas by Jean from catswhocode.com
@@ -7429,7 +7426,10 @@ function do_password_hash_code_update() {
 	// There's no point if we're using Argon2i, as it doesn't take a cost
 	if(hash_password_properties()["algorithm"] == PASSWORD_ARGON2I)
 		return;
-	
+		
+	// Skip rechecking if the automatic check has been disabled
+	if($settings->password_cost_time_interval == -1)
+		return;
 	// Skip the recheck if we've done one recently
 	if(isset($settings->password_cost_time_lastcheck) &&
 		time() - $settings->password_cost_time_lastcheck < $settings->password_cost_time_interval)
diff --git a/core.php b/core.php
index aac665c..2b0903a 100644
--- a/core.php
+++ b/core.php
@@ -1274,13 +1274,13 @@ class page_renderer
 	 */
 	public static function get_css_as_html()
 	{
-		global $settings;
+		global $settings, $defaultCSS;
 
 		if(preg_match("/^[^\/]*\/\/|^\//", $settings->css))
 			return "<link rel='stylesheet' href='$settings->css' />\n";
 		else
 		{
-			$css = $settings->css;
+			$css = $settings->css == "auto" ? $defaultCSS : $settings->css;
 			if(!empty($settings->optimize_pages))
 			{
 				// CSS Minification ideas by Jean from catswhocode.com
diff --git a/module_index.json b/module_index.json
index b9864b2..aa1ae47 100755
--- a/module_index.json
+++ b/module_index.json
@@ -203,7 +203,7 @@
         "author": "Starbeamrainbowlabs",
         "description": "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.",
         "id": "page-login",
-        "lastupdate": 1525991211,
+        "lastupdate": 1525991341,
         "optional": false
     },
     {
diff --git a/settings.fragment.php b/settings.fragment.php
index 7d35e94..95c4c00 100644
--- a/settings.fragment.php
+++ b/settings.fragment.php
@@ -64,7 +64,4 @@ if($settingsUpgraded)
 $defaultCSS = <<<THEMECSS
 {default-css}
 THEMECSS;
-if($settings->css === "auto")
-	$settings->css = $defaultCSS;
-
 ?>
