summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/lib/pkgfuncs.inc7
-rw-r--r--web/template/pkg_search_form.php2
2 files changed, 7 insertions, 2 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 ";
diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php
index e570dfbc..807b323f 100644
--- a/web/template/pkg_search_form.php
+++ b/web/template/pkg_search_form.php
@@ -38,7 +38,7 @@
<label><?php print __("Search by"); ?></label>
<select name='SeB'>
<?php
- $searchby = array('nd' => __('Name, Description'), 'n' => __('Name Only'), 'm' => __('Maintainer'), 's' => __('Submitter'));
+ $searchby = array('nd' => __('Name, Description'), 'n' => __('Name Only'), 'x' => ('Exact name'), 'm' => __('Maintainer'), 's' => __('Submitter'));
foreach ($searchby as $k => $v):
if (isset($_REQUEST['SeB']) && $_REQUEST['SeB'] == $k):
?>