summaryrefslogtreecommitdiffstats
path: root/all.php
diff options
context:
space:
mode:
Diffstat (limited to 'all.php')
-rw-r--r--all.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/all.php b/all.php
index 018f55e..6c408f0 100644
--- a/all.php
+++ b/all.php
@@ -63,12 +63,16 @@ function report ($db)
if (substr($what, 0, 1)=='%') {
+ $l = substr($what, 1, 1);
+ if (!ctype_alpha($l) && !ctype_digit($l)) {
+ $l = 'a';
+ }
$sql = sprintf(
"SELECT DISTINCT name
FROM rpm
- WHERE SUBSTRING(name,1,1) = %s
+ WHERE NAME LIKE '%s%%'
ORDER BY name",
- $db->quote(substr($what, 1, 1))
+ $l
);
} else {
$sql = sprintf(
@@ -243,4 +247,4 @@ $page_content = $smarty->fetch('all.tpl');
$smarty->assign('page_content', $page_content);
$smarty->display('main.tpl');
-?> \ No newline at end of file
+?>