Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/mysql.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-03-27 11:46:35 +0100
committerErich Eckner <git@eckner.net>2019-03-27 11:46:35 +0100
commit1c3eb159945e8f4c0f9006498c93cdcc19724cb9 (patch)
tree903fa8f2d09b477e93cd2002bcf9a570d9d7c96a /lib/mysql.php
parentea8659f141fd14165af05bd9cd06bf95919447f2 (diff)
buildmaster/statistics.php: arch_filter_query() separated into lib/mysel.php
Diffstat (limited to 'lib/mysql.php')
-rw-r--r--lib/mysql.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 2193ab1..ca683d8 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -87,3 +87,14 @@ function mysql_query_package_version($table) {
")" .
")";
}
+
+function arch_filter_query($table) {
+ $arch_filter="`" . $table . "`.`name` IN (\"\"";
+ foreach (explode("&", $_SERVER["QUERY_STRING"]) as $param) {
+ if (strpos($param, "arch=")!==0)
+ continue;
+ $arch_filter .= ",from_base64(\"" . base64_encode(substr($param,5)) . "\")";
+ }
+ $arch_filter .= ")";
+ return $arch_filter;
+}