1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 01:35:02 +00:00

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.
This commit is contained in:
Benjamin Spiegel 2023-05-22 00:55:13 -05:00
parent 484f71fc6c
commit 3abad2e61e

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