"Show only the 2 most relevant links from each site" broken in 2.3.1

Come here for help or to post comments on Sphider
Post Reply
User avatar
captquirk
Site Admin
Posts: 97
Joined: Sun Apr 09, 2017 8:49 pm
Location: Arizona, USA
Contact:

"Show only the 2 most relevant links from each site" broken in 2.3.1

Post by captquirk » Mon Mar 11, 2019 2:33 am

Another of the deprecated each() function replacements has come back to haunt Sphider 2.3.1.

This has been corrected for the next release, but for those you can't wait, the fix is easy. Open the include/searchfuncs.php file and look for this code:

Code: Select all

            $k = $domains_to_show[$domains[$key]][0];
            $v = $domains_to_show[$domains[$key]][1];
            $result_array[$k] = $v;
In the PDO edition, this will be around line 681-683. In the legacy edition, it will be around line 591-594.
Substitute the above block of code with this:

Code: Select all

            foreach ($domains_to_show as $thisdomain) {
                foreach ($thisdomain as $k => $v) {
                    $result_array[$k] = $v;
                }
            }

Post Reply