[aur-dev] [PATCH 1/2] Fix links to AUR packages in optional dependencies
Extend the SQL query that tries to find a package's dependencies so that optional dependencies with a description are correctly resolved. Fixes FS#40700. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/pkgfuncs.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 3bbf1a1..fed7c03 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -170,6 +170,7 @@ function pkg_dependencies($pkgid) { $dbh = DB::connect(); $q = "SELECT pd.DepName, dt.Name, pd.DepCondition, p.ID FROM PackageDepends pd "; $q.= "LEFT JOIN Packages p ON pd.DepName = p.Name "; + $q.= "OR SUBSTRING(pd.DepName FROM 1 FOR POSITION(': ' IN pd.DepName) - 1) = p.Name "; $q.= "LEFT JOIN DependencyTypes dt ON dt.ID = pd.DepTypeID "; $q.= "WHERE pd.PackageID = ". $pkgid . " "; $q.= "ORDER BY pd.DepName"; -- 2.0.0
uid_from_username() returns a non-integer value when the user does not exist. This results in a broken SQL query when searching for a nonexistent submitter. Fix this by explicitly converting the result of uid_from_username() to an integer. Fixes FS#40625. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/pkgfuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index fed7c03..c736051 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -586,7 +586,7 @@ function pkg_search_page($SID="") { } elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "s") { /* Search by submitter. */ - $q_where .= "AND SubmitterUID = ".uid_from_username($_GET['K'])." "; + $q_where .= "AND SubmitterUID = " . intval(uid_from_username($_GET['K'])) . " "; } elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "n") { /* Search by name. */ -- 2.0.0
participants (1)
-
Lukas Fleischer