Compare commits

...

3 Commits

Author SHA1 Message Date
Ben Spiegel 1d94c2d291
Merge 3abad2e61e into 951a08dde8 2024-02-07 11:20:30 -07: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
2 changed files with 5 additions and 4 deletions

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

@ -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