1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +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 continue; // Skip terms we shouldn't search the page body for
// Loop over the pageindex and search the titles / tags // Loop over the pageindex and search the titles / tags
reset($pageindex); // Reset array/object pointer $obj = new ArrayObject($pageindex);
foreach($pageindex as $pagename => $pagedata) { $it = $obj->getIterator();
foreach($it as $pagename => $pagedata) {
// Setup a variable to hold the current page's id // Setup a variable to hold the current page's id
$pageid = null; // Cache the page id $pageid = null; // Cache the page id