1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 16:33:00 +00:00

Squash warnings from file_get_contents in the peppermint.json access check

This commit is contained in:
Starbeamrainbowlabs 2019-09-18 11:28:47 +01:00
parent c63ea80fc1
commit f7943365d5
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 16 additions and 15 deletions

View file

@ -55,7 +55,7 @@
"version": "0.3.2", "version": "0.3.2",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a sidebar to the left hand side of every page. Add '$settings->sidebar_show = true;' to your configuration, or append '&sidebar=yes' to the url to enable. Adding to the url sets a cookie to remember your setting.", "description": "Adds a sidebar to the left hand side of every page. Add '$settings->sidebar_show = true;' to your configuration, or append '&sidebar=yes' to the url to enable. Adding to the url sets a cookie to remember your setting.",
"lastupdate": 1567528758, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -75,7 +75,7 @@
"version": "0.1", "version": "0.1",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Displays a special page to aid in setting up a new wiki for the first time.", "description": "Displays a special page to aid in setting up a new wiki for the first time.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -85,7 +85,7 @@
"version": "0.1.5", "version": "0.1.5",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.", "description": "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -95,7 +95,7 @@
"version": "0.4.2", "version": "0.4.2",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds the ability to keep unlimited page history, limited only by your disk space. Note that this doesn't store file history (yet). Currently depends on feature-recent-changes for rendering of the history page.", "description": "Adds the ability to keep unlimited page history, limited only by your disk space. Note that this doesn't store file history (yet). Currently depends on feature-recent-changes for rendering of the history page.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -135,7 +135,7 @@
"version": "0.10.1", "version": "0.10.1",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.", "description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.",
"lastupdate": 1567528763, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -145,7 +145,7 @@
"version": "0.2.2", "version": "0.2.2",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "An extensible statistics calculation system. Comes with a range of built-in statistics, but can be extended by other modules too.", "description": "An extensible statistics calculation system. Comes with a range of built-in statistics, but can be extended by other modules too.",
"lastupdate": 1567528768, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -155,7 +155,7 @@
"version": "0.3", "version": "0.3",
"author": "Starbeamrainbowlabs", "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.", "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": 1567528753, "lastupdate": 1568296832,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -165,7 +165,7 @@
"version": "0.6.1", "version": "0.6.1",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.", "description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -205,7 +205,7 @@
"version": "0.2", "version": "0.2",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a debug action for administrator use only that collects a load of useful information to make reporting bugs easier.", "description": "Adds a debug action for administrator use only that collects a load of useful information to make reporting bugs easier.",
"lastupdate": 1568229660, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -215,7 +215,7 @@
"version": "0.10.2", "version": "0.10.2",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds an action to allow administrators to delete pages.", "description": "Adds an action to allow administrators to delete pages.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -225,7 +225,7 @@
"version": "0.17.5", "version": "0.17.5",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.", "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": { "extra_data": {
"diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js" "diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js"
@ -247,7 +247,7 @@
"version": "0.10", "version": "0.10",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a rather useful help page. Access through the 'help' action. This module also exposes help content added to Pepperminty Wiki's inbuilt invisible help section system.", "description": "Adds a rather useful help page. Access through the 'help' action. This module also exposes help content added to Pepperminty Wiki's inbuilt invisible help section system.",
"lastupdate": 1567107944, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -257,7 +257,7 @@
"version": "0.11.3", "version": "0.11.3",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a page that lists all the pages in the index along with their metadata.", "description": "Adds a page that lists all the pages in the index along with their metadata.",
"lastupdate": 1567530955, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },
@ -337,7 +337,7 @@
"version": "0.10", "version": "0.10",
"author": "Emanuil Rusev & Starbeamrainbowlabs", "author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation.", "description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation.",
"lastupdate": 1567530862, "lastupdate": 1568296731,
"optional": false, "optional": false,
"extra_data": { "extra_data": {
"Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php", "Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php",

View file

@ -50,7 +50,8 @@ register_module([
php_sapi_name() !== "cli-server") { // The CLI server is single threaded, so it can't support loopback requests php_sapi_name() !== "cli-server") { // The CLI server is single threaded, so it can't support loopback requests
$request_url = full_url(); $request_url = full_url();
$request_url = preg_replace("/\/(index.php)?\?.*$/", "/peppermint.json", $request_url); $request_url = preg_replace("/\/(index.php)?\?.*$/", "/peppermint.json", $request_url);
file_get_contents($request_url); @file_get_contents($request_url);
// $http_response_header is a global reserved variable. More information: https://devdocs.io/php/reserved.variables.httpresponseheader
$response_code = intval(explode(" ", $http_response_header[0])[1]); $response_code = intval(explode(" ", $http_response_header[0])[1]);
if($response_code >= 200 || $response_code < 300) { if($response_code >= 200 || $response_code < 300) {
file_put_contents("$settingsFilename.compromised", "compromised"); file_put_contents("$settingsFilename.compromised", "compromised");