summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-05 13:32:43 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-05 13:51:28 +0200
commitc1c77836a8b1e01f6a6f69d3cdd35321d5bf203e (patch)
tree20832b94f9da2635a990384a5f353f6145c3e381 /web/lib/pkgfuncs.inc.php
parent68d99df78176cc7db0386a522528399b0b89b0e9 (diff)
downloadaurweb-c1c77836a8b1e01f6a6f69d3cdd35321d5bf203e.tar.xz
Allow for searching by package base name
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index b92eb9c..a63ee6f 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -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'], '%_') . "%";