1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-25 17:23:00 +00:00

Update changelog

This commit is contained in:
Starbeamrainbowlabs 2018-06-30 11:20:53 +01:00
parent aa77f3f2db
commit 20e3596f4e
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 30 additions and 28 deletions

View file

@ -5,6 +5,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
### Added ### Added
- [Module API] Added `save_settings()` convenience method - [Module API] Added `save_settings()` convenience method
- [Rest API] Add `user-add` and `set-password` moderator actions
### Fixed ### Fixed
- Updated the search system to transliterate characters to better support searching pages that are written in other languages. - Updated the search system to transliterate characters to better support searching pages that are written in other languages.
@ -13,7 +14,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- The PHP function `openssl_pseudo_random_bytes()` was being used before, but [apparently that's not cryptographically secure](https://paragonie.com/blog/2015/07/how-safely-generate-random-strings-and-integers-in-php). - The PHP function `openssl_pseudo_random_bytes()` was being used before, but [apparently that's not cryptographically secure](https://paragonie.com/blog/2015/07/how-safely-generate-random-strings-and-integers-in-php).
- [Module API] Fix `full_url()` logic - [Module API] Fix `full_url()` logic
- [Module API] Make `email_user()` correctly return email sending failures - [Module API] Make `email_user()` correctly return email sending failures
- [Rest API] Add `user-add` and `set-password` moderator actions - Squashed a warning in the search redirector
## Changed ## 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. - Password hashing has been overhauled! A totally new-and-different system is being used now, so you'll need to rehash all your passwords.

View file

@ -297,7 +297,7 @@ a.redlink:visited { color: rgb(130, 15, 15); /*#8b1a1a*/ }
.search-result::after { content: "Rank: " attr(data-rank); position: absolute; top: 3.8rem; right: 0.7rem; color: rgba(50, 50, 50, 0.3); } .search-result::after { content: "Rank: " attr(data-rank); position: absolute; top: 3.8rem; right: 0.7rem; color: rgba(50, 50, 50, 0.3); }
.search-result > h2 { margin-left: 3rem; } .search-result > h2 { margin-left: 3rem; }
.search-result-badges { font-size: 1rem; font-weight: normal; } .search-result-badges { font-size: 1rem; font-weight: normal; }
.search-context { max-height: 20em; overflow: hidden; } .search-context { min-height: 3em; max-height: 20em; overflow: hidden; }
.search-context::after { content: ""; position: absolute; bottom: 0; width: 100%; height: 3em; display: block; background: linear-gradient(to bottom, transparent, #faf8fb); pointer-events: none; } .search-context::after { content: ""; position: absolute; bottom: 0; width: 100%; height: 3em; display: block; background: linear-gradient(to bottom, transparent, #faf8fb); pointer-events: none; }
textarea[name=content] { resize: none; } textarea[name=content] { resize: none; }
@ -397,7 +397,7 @@ if($settings->sessionprefix == "auto")
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/** The version of Pepperminty Wiki currently running. */ /** The version of Pepperminty Wiki currently running. */
$version = "v0.17-dev"; $version = "v0.17-dev";
$commit = "8403ffd5c3de9725756bcfc5929ce9239be1379b"; $commit = "cdee30c2861c0ae91573214105caa659da38ac7d";
/// Environment /// /// Environment ///
/** Holds information about the current request environment. */ /** Holds information about the current request environment. */
$env = new stdClass(); $env = new stdClass();
@ -1923,15 +1923,8 @@ $env->action = strtolower($_GET["action"]);
////////////////////////////////////// //////////////////////////////////////
///// Extra consistency measures ///// ///// Extra consistency measures /////
////////////////////////////////////// //////////////////////////////////////
// Redirect to the search page if there isn't a page with the requested name
if(!isset($pageindex->{$env->page}) and isset($_GET["search-redirect"])) // CHANGED: The search redirector has now been moved to below the module registration system, as it was causing a warning here
{
http_response_code(307);
$url = "?action=search&query=" . rawurlencode($env->page);
header("location: $url");
exit(page_renderer::render("Non existent page - $settings->sitename", "<p>There isn't a page on $settings->sitename with that name. However, you could <a href='$url'>search for this page name</a> in other pages.</p>
<p>Alternatively, you could <a href='?action=edit&page=" . rawurlencode($env->page) . "&create=true'>create this page</a>.</p>"));
}
// Redirect the user to the login page if: // Redirect the user to the login page if:
// - A login is required to view this wiki // - A login is required to view this wiki
@ -4188,26 +4181,17 @@ class search
$index = []; $index = [];
$terms = self::tokenize($source); $terms = self::tokenize($source, true);
$i = 0;
foreach($terms as $term) foreach($terms as $term)
{ {
$nterm = $term;
// Skip over stop words (see https://en.wikipedia.org/wiki/Stop_words) // Skip over stop words (see https://en.wikipedia.org/wiki/Stop_words)
if(in_array($nterm, self::$stop_words)) { $i++; continue; } if(in_array($term[0], self::$stop_words)) continue;
if(!isset($index[$nterm])) if(!isset($index[$term[0]]))
{ $index[$term[0]] = [ "freq" => 0, "offsets" => [] ];
$index[$nterm] = [ "freq" => 0, "offsets" => [] ];
}
// FIXME: Here we use the index of the token in the array, when we want the number of characters into the page! $index[$term[0]]["freq"]++;
$index[$nterm]["freq"]++; $index[$term[0]]["offsets"][] = $term[1];
$index[$nterm]["offsets"][] = $i;
$i++;
} }
return $index; return $index;
@ -9230,6 +9214,23 @@ foreach($remote_files as $remote_file_def) {
file_put_contents($remote_file_def["local_filename"], fopen($remote_file_def["remote_url"], "rb")); file_put_contents($remote_file_def["local_filename"], fopen($remote_file_def["remote_url"], "rb"));
} }
//////////////////////////////////
/// Final Consistency Measures ///
//////////////////////////////////
// Redirect to the search page if there isn't a page with the requested name
if(!isset($pageindex->{$env->page}) and isset($_GET["search-redirect"]))
{
http_response_code(307);
$url = "?action=search&query=" . rawurlencode($env->page);
header("location: $url");
exit(page_renderer::render_minimal("Non existent page - $settings->sitename", "<p>There isn't a page on $settings->sitename with that name. However, you could <a href='$url'>search for this page name</a> in other pages.</p>
<p>Alternatively, you could <a href='?action=edit&page=" . rawurlencode($env->page) . "&create=true'>create this page</a>.</p>"));
}
//////////////////////////////////
// Perform the appropriate action // Perform the appropriate action
$action_name = $env->action; $action_name = $env->action;
if(isset($actions->$action_name)) if(isset($actions->$action_name))

View file

@ -104,7 +104,7 @@
"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.",
"id": "feature-search", "id": "feature-search",
"lastupdate": 1530313680, "lastupdate": 1530352734,
"optional": false "optional": false
}, },
{ {