Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=homepage-ng.git;a=commitdiff;h=af3f433f44e5f2111640aa9a9366cc7c32a4e1d5
commit af3f433f44e5f2111640aa9a9366cc7c32a4e1d5
Author: Krisztian VASAS <[EMAIL PROTECTED]>
Date: Mon Oct 8 10:13:12 2007 +0200
fwng: last patch fixed the query, but got another small error - now fixed
diff --git a/frugalware/packages.php b/frugalware/packages.php
index 03e08f2..4ed9e55 100644
--- a/frugalware/packages.php
+++ b/frugalware/packages.php
@@ -150,8 +150,8 @@ function search_pkg()
main();
return;
}
- $search = addcslashes( $_GET['srch'], '+' );
- $search = str_replace( '+', '\+', $search );
+ $search = $_GET['srch'];
+ $srch = str_replace( '+', '\+', addcslashes( $search, '+' ) );
$arch = $_GET['arch'];
$fwver = $_GET['ver'];
$sub = ($_GET['sub'] == "on") ? 1 : 0; # whether the search is for a substring
or exact match
@@ -159,7 +159,7 @@ function search_pkg()
$query = "select id, pkgname, pkgver, fwver, arch from packages where ";
# if the 'desc' is set (searching in description, too) I have to put
# the restrictions between brackets, because of the 'arch' below...
- ($_GET['desc'] == "on" || $_GET['desc'] == 1) ? $query .= "(pkgname
rlike '$search' or `desc` rlike '$search')" : $query .= "(pkgname rlike
'$search')";
+ ($_GET['desc'] == "on" || $_GET['desc'] == 1) ? $query .= "(pkgname
rlike '$srch' or `desc` rlike '$srch')" : $query .= "(pkgname rlike '$srch')";
if ($arch != "" and $arch != "all")
{
$query .= " and arch='$arch'";
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git