summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-04-06 19:21:12 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2011-04-06 19:21:19 +0200
commit1c55e6b40c015f3c3b15681aa181ef2dfbd8b106 (patch)
treed09b4289c964f3fb69131adb83ffd8dab19cfb51 /web/lib/pkgfuncs.inc
parent8cd2aef50d96ee68dc08738a4ddf94ed58f28db4 (diff)
downloadaur-1c55e6b40c015f3c3b15681aa181ef2dfbd8b106.tar.gz
aur-1c55e6b40c015f3c3b15681aa181ef2dfbd8b106.tar.xz
Add option to search for exact name matches only (fixes FS#23556).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgfuncs.inc')
-rw-r--r--web/lib/pkgfuncs.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index e4323554..3013b443 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -341,6 +341,7 @@ function package_details($id=0, $SID="") {
* SeB- property that search string (K) represents
* values: n - package name
* nd - package name & description
+ * x - package name (exact match)
* m - package maintainer's username
* s - package submitter's username
* do_Orphans - boolean. whether to search packages
@@ -440,11 +441,15 @@ function pkg_search_page($SID="") {
# Search by submitter
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "s") {
$q_where .= "AND SubmitterUID = ".uid_from_username($_GET['K'])." ";
- # Search by name
}
+ # Search by name
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "n") {
$q_where .= "AND (Name LIKE '%".$_GET['K']."%') ";
}
+ # Search by name (exact match)
+ elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "x") {
+ $q_where .= "AND (Name = '".$_GET['K']."') ";
+ }
# Search by name and description (Default)
else {
$q_where .= "AND (Name LIKE '%".$_GET['K']."%' OR ";