Page 1 of 1

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

Posted: Mon Mar 11, 2019 2:33 am
by captquirk
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;
                }
            }