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
1 changed files with 3 additions and 2 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