Commit c1c77836 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Allow for searching by package base name



Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 68d99df7
......@@ -681,10 +681,19 @@ function pkg_search_page($SID="") {
$K = "%" . addcslashes($_GET['K'], '%_') . "%";
$q_where .= "AND (Packages.Name LIKE " . $dbh->quote($K) . ") ";
}
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "x") {
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "b") {
/* Search by package base name. */
$K = "%" . addcslashes($_GET['K'], '%_') . "%";
$q_where .= "AND (PackageBases.Name LIKE " . $dbh->quote($K) . ") ";
}
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "N") {
/* Search by name (exact match). */
$q_where .= "AND (Packages.Name = " . $dbh->quote($_GET['K']) . ") ";
}
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "B") {
/* Search by package base name (exact match). */
$q_where .= "AND (PackageBases.Name = " . $dbh->quote($_GET['K']) . ") ";
}
else {
/* Search by name and description (default). */
$K = "%" . addcslashes($_GET['K'], '%_') . "%";
......
......@@ -4,7 +4,9 @@ include_once('pkgfuncs.inc.php');
$searchby = array(
'nd' => __('Name, Description'),
'n' => __('Name Only'),
'x' => __('Exact name'),
'b' => __('Package Base'),
'N' => __('Exact Name'),
'B' => __('Exact Package Base'),
'm' => __('Maintainer'),
's' => __('Submitter')
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment