[aur-dev] [PATCH] pkgfuncs.inc.php: Avoid printing duplicates in "Required by"
Packages with multiple DepConditions are returned multiple times in the "Required by" column. Array is multi-dimensional so cannot have array_unique() run over it directly to remove duplicates. Serialize the array, remove duplicates, then unserialize the array. Fixes FS#32478 Signed-off-by: canyonknight <canyonknight@gmail.com> --- web/lib/pkgfuncs.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 8f84cdf..4beaec3 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -178,6 +178,8 @@ function package_required($name="", $dbh=NULL) { while ($row = $result->fetch(PDO::FETCH_NUM)) { $deps[] = $row; } + + $deps = array_map('unserialize', array_unique(array_map('serialize', $deps))); } return $deps; } -- 1.8.0
participants (1)
-
canyonknight