From ab033c7fd33e699fe19a512295f4d65240784404 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 20 Oct 2019 01:25:02 +0100 Subject: [PATCH] Bugfix: Fix internal theme reset button --- module_index.json | 2 +- modules/feature-theme-gallery.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/module_index.json b/module_index.json index 6012e4a..73a5746 100755 --- a/module_index.json +++ b/module_index.json @@ -155,7 +155,7 @@ "version": "0.3", "author": "Starbeamrainbowlabs", "description": "Adds a theme gallery page and optional automatic theme updates. Contacts a remote server, where IP addresses are stored in automatic server logs for security and attack mitigation purposes.", - "lastupdate": 1571530718, + "lastupdate": 1571531070, "optional": false, "extra_data": [] }, diff --git a/modules/feature-theme-gallery.php b/modules/feature-theme-gallery.php index 7c6fd50..0a2d4d8 100644 --- a/modules/feature-theme-gallery.php +++ b/modules/feature-theme-gallery.php @@ -121,9 +121,14 @@ register_module([ if($_GET["theme-selector"] === "default-internal") { $settings->css_theme_gallery_selected_id = $guiConfig->css_theme_gallery_selected_id->default; - $settings->css_theme_gallery_selected_id = $guiConfig->css_theme_gallery_selected_id->default; + $settings->css_theme_autoupdate_url = $guiConfig->css_theme_autoupdate_url->default; $settings->css = $guiConfig->css->default; + if(!save_settings()) { + http_response_code(503); + exit(page_renderer::render_main("Server error - $settings->sitename", "

Oops! $settings->sitename wasn't able to save the peppermint.json settings file back to disk. If you're the administrator, try checking the permissions on disk. If not, try contacting $settings->sitename's administrator, who's contact details can be found at the bottom of every page.

")); + } + exit(page_renderer::render_main("Theme reset - Theme Gallery - $settings->sitename", "

$settings->sitename's theme has been reset to the internal theme.

Go to the homepage.

")); }