diff --git a/.gitignore b/.gitignore index 3a1216a..95b8a67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.serenata *.backup themes/**/*.png themes/themeindex.json diff --git a/module_index.json b/module_index.json index 2f393ac..b3eb12c 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": 1569770257, + "lastupdate": 1570462781, "optional": false, "extra_data": [] }, diff --git a/modules/feature-theme-gallery.php b/modules/feature-theme-gallery.php index 3ef7d5c..4cfb143 100644 --- a/modules/feature-theme-gallery.php +++ b/modules/feature-theme-gallery.php @@ -26,8 +26,25 @@ register_module([ exit(page_renderer::render_main("Error - $settings->sitename", $errorMessage)); } - $themes_available = []; $gallery_urls = explode(" ", $settings->css_theme_gallery_index_url); + + if(!isset($_GET["load"]) || $_GET["load"] !== "yes") { + $result = "

Theme Gallery

+

Load the theme gallery? A HTTP request will be made to the following endpoints:

+ +

...with the following user agent string: ".ini_get("user_agent")."

+

No external HTTP requests will be made without your consent.

+

Ok, load the gallery.

+

Actually, take me back.

"; + exit(page_renderer::render_main("Theme Gallery - $settings->sitename", $result)); + } + + $themes_available = []; + foreach($gallery_urls as $url) { if(empty($url)) continue; $next_obj = json_decode(@file_get_contents($url)); diff --git a/themes/default/theme.css b/themes/default/theme.css index e346ac9..59175dd 100644 --- a/themes/default/theme.css +++ b/themes/default/theme.css @@ -165,12 +165,12 @@ blockquote { padding-left: 1em; border-left: 0.2em solid var(--accent-a3); borde pre { white-space: pre-wrap; } a { cursor: pointer; } +a:focus { outline-width: 0.1em; } a.redlink:link { color: var(--accent-c1); } a.redlink:visited { color: var(--accent-c2); } a.redlink:active, a.redlink:focus { color: var(--accent-c3); } a.interwiki_link::before { content: "\\1f6f8"; display: inline-block; margin-right: 0.25em; } a.interwiki_link { color: var(--accent-d1); } -a:focus { outline-width: 0.1em; } .matching-tags-display { display: flex; margin: 0 -2em; padding: 1em 2em; background: hsla(30, 84%, 72%, 0.75); } .matching-tags-display > label { flex: 0; font-weight: bold; color: var(--accent-a3); }