search.php: - prevent script crash when usort() is performed on an empty database result, when using full-body search
This commit is contained in:
parent
18559b6299
commit
72b83b55e5
Rocksolid_Light/rocksolid
|
@ -286,9 +286,14 @@ function get_body_search($group, $terms) {
|
||||||
}
|
}
|
||||||
$dbh = null;
|
$dbh = null;
|
||||||
}
|
}
|
||||||
usort($overview, function($a, $b) {
|
// do not perform a usort of an empty search result
|
||||||
|
if ($overview != null)
|
||||||
|
{
|
||||||
|
usort($overview,
|
||||||
|
function($a, $b) {
|
||||||
return $a['rank'] <=> $b['rank'];
|
return $a['rank'] <=> $b['rank'];
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return $overview;
|
return $overview;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue