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
- [Module API] Added `save_settings()` convenience method
- [Rest API] Add `user-add` and `set-password` moderator actions
### Fixed
- 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).
- [Module API] Fix `full_url()` logic
- [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
- 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 > h2 { margin-left: 3rem; }
.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; }
textarea[name=content] { resize: none; }
@ -397,7 +397,7 @@ if($settings->sessionprefix == "auto")
/////////////////////////////////////////////////////////////////////////////
/** The version of Pepperminty Wiki currently running. */
$version = "v0.17-dev";
$commit = "8403ffd5c3de9725756bcfc5929ce9239be1379b";
$commit = "cdee30c2861c0ae91573214105caa659da38ac7d";
/// Environment ///
/** Holds information about the current request environment. */
$env = new stdClass();
@ -1923,15 +1923,8 @@ $env->action = strtolower($_GET["action"]);
//////////////////////////////////////
///// 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"]))
{
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>"));
}
// CHANGED: The search redirector has now been moved to below the module registration system, as it was causing a warning here
// Redirect the user to the login page if:
// - A login is required to view this wiki
@ -4188,26 +4181,17 @@ class search
$index = [];
$terms = self::tokenize($source);
$i = 0;
$terms = self::tokenize($source, true);
foreach($terms as $term)
{
$nterm = $term;
// 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]))
{
$index[$nterm] = [ "freq" => 0, "offsets" => [] ];
}
if(!isset($index[$term[0]]))
$index[$term[0]] = [ "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[$nterm]["freq"]++;
$index[$nterm]["offsets"][] = $i;
$i++;
$index[$term[0]]["freq"]++;
$index[$term[0]]["offsets"][] = $term[1];
}
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"));
}
//////////////////////////////////
/// 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
$action_name = $env->action;
if(isset($actions->$action_name))

View File

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