Compare commits

...

5 Commits

Author SHA1 Message Date
Ben Spiegel ba9bfac0ca
Merge 3abad2e61e into 16354b467e 2024-02-17 22:57:39 -07:00
Starbeamrainbowlabs 16354b467e
page-edit: fix typo 2024-02-10 19:25:10 +00:00
Starbeamrainbowlabs 4b81c2334a
CONTRIBUTING: tweak wording 2024-02-08 01:56:36 +00:00
Benjamin Spiegel 3abad2e61e Replace deprecated reset(object)
Calling `reset()` on an object causes warnings starting in PHP 8.2.
This commit replaces one instance with ArrayIterator object and
getIterator() method following a recommendation in the deprecation
notice RFC.
2023-06-05 21:48:14 -05:00
Benjamin Spiegel 484f71fc6c Replace deprecated ${var} in strings with {$var}
Using `${var}` to embed variables in strings causes warnings starting
in PHP 8.2. This commit replaces two instances with `{$var}`, following
recommendations in the deprecation notice and related RFC.
2023-05-22 00:34:20 -05:00
5 changed files with 14 additions and 11 deletions

View File

@ -1,7 +1,7 @@
# Contributors guide
Contributions are very welcome - both issues and pull requests! Please mention in your pull request that you release your work under the MPL-2.0 (see below).
While Pepperminty Wiki is a huge long-time passion of mine, at times it may take up to 2 weeks at times for me to respond to issues and pull requests. If it has been a few days and you have not received a reply, consider joining [the Gitter/Matrix chat](https://app.gitter.im/#/room/#Pepperminty-Wiki_Lobby:gitter.im) and poking me on there.
While Pepperminty Wiki is a huge long-time passion of mine, due to life stuff at times it may take up to 2 weeks at times for me to respond to issues and pull requests. If it has been a few days and you have not received a reply, consider joining [the Gitter/Matrix chat](https://app.gitter.im/#/room/#Pepperminty-Wiki_Lobby:gitter.im) and poking me on there.
I recommend checking on your pull request or issue every few days for a reply.

View File

@ -6,8 +6,10 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
This is the next release of Pepperminty Wiki, that hasn't been released yet.
- **Fixed:** Fixed link to the interwiki links documentation on the help page if interwiki links have not yet been setup.
- **Fixed:** Fixed typos in system text
- **Changed:** Catch and deal with more unpacking issues on first run (thanks, @daveschroeter in [#249](https://github.com/sbrl/Pepperminty-Wiki/issues/249))
## v0.24
- **Added:** `filter` GET parameter to the `list` action, which filters the list of pages to contain only those containing the specified substring.
- **Fixed:** [Rest API] Documented `redirect` and `redirected_from` GET params to the `view` action.

View File

@ -831,8 +831,9 @@ class search
continue; // Skip terms we shouldn't search the page body for
// Loop over the pageindex and search the titles / tags
reset($pageindex); // Reset array/object pointer
foreach($pageindex as $pagename => $pagedata) {
$obj = new ArrayObject($pageindex);
$it = $obj->getIterator();
foreach($it as $pagename => $pagedata) {
// Setup a variable to hold the current page's id
$pageid = null; // Cache the page id

View File

@ -1,11 +1,11 @@
<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
register_module([
"name" => "Page editor",
"version" => "0.19",
"version" => "0.19.1",
"author" => "Starbeamrainbowlabs",
"description" => "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
"id" => "page-edit",
@ -88,7 +88,7 @@ register_module([
$sourceViewContent = "<p>$settings->sitename currently has editing disabled, so you can't make changes to this page at this time. Please contact ".htmlentities($settings->admindetails_name).", $settings->sitename's administrator for more information - their contact details can be found at the bottom of this page. Even so, you can still view the source of this page. It's disabled below:</p>";
if($isOtherUsersPage)
$sourceViewContent = "<p>$env->page_safe is a special user page which acutally belongs to " . htmlentities(extract_user_from_userpage($env->page)) . ", another user on $settings->sitename. Because of this, you are not allowed to edit it (though you can always edit your own page and any pages under it if you're logged in). You can, however, vieww it's source below.</p>";
$sourceViewContent = "<p>$env->page_safe is a special user page which actually belongs to " . htmlentities(extract_user_from_userpage($env->page)) . ", another user on $settings->sitename. Because of this, you are not allowed to edit it (though you can always edit your own page and any pages under it if you're logged in). You can, however, view it's source below.</p>";
// Append a view of the page's source
$sourceViewContent .= "<textarea name='content' readonly>".htmlentities($pagetext)."</textarea>";

View File

@ -1101,9 +1101,9 @@ class PeppermintParsedown extends ParsedownExtra
// The page name is made safe when Pepperminty Wiki does initial consistency checks (if it's unsafe it results in a 301 redirect)
$page_name = parsedown_pagename_resolve($matches_url[1]);
$internal_link_text = "[[${page_name}]]";
$internal_link_text = "[[{$page_name}]]";
if(!empty($matches[1])) // If the display text isn't empty, then respect it
$internal_link_text = "[[${page_name}¦{$matches[1]}]]";
$internal_link_text = "[[{$page_name}¦{$matches[1]}]]";
$result = $this->inlineInternalLink([
"text" => $internal_link_text