From 9093deb385bb32eddd5149cd68c3eecb65a9c415 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 22 Sep 2023 17:26:37 +0200 Subject: [PATCH] filter foreign languages and system pages from search results --- handlers/40_search.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handlers/40_search.sh b/handlers/40_search.sh index f057e45..823ef76 100644 --- a/handlers/40_search.sh +++ b/handlers/40_search.sh @@ -36,6 +36,11 @@ done \ | sort -nr \ | while read freq doc; do page="$(UNSTRING "$doc")" + [ "${page%*/\[*\]/*}" != "$page" ] && continue + if [ "$LANGUAGE_DEFAULT" ]; then + [ -d "${_DATA}/pages/${page}/:${LANGUAGE}/" ] && continue + [ "${page%/:*/}" = "${page%/:${LANGUAGE}/}" ] || continue + fi acl_read "$page" || continue printf '
  • %s
  • ' "$(URL "$page")" "$(HTML "$page")" done \ -- 2.39.2