While reviewing #56, a gap in the exclude_tags filtering came up. In DB mode, both the text formatter and the new JSON formatter for search compare page results against the excluded name set using fullTitle or title or content as the key. If a page result has neither fullTitle nor title and its content doesn't hold the page name, the exclusion check silently fails open and the page is shown even though it should be filtered.
In practice DB-mode search returns page entries with content equal to the page title, so the chance of this actually leaking a page is low. That's why I'm filing this as low priority rather than fixing it right away.
Possible fixes when we get to it:
- Match against page UUIDs instead of names. DB-mode results carry the page UUID, which would be more robust than string comparison.
- Or fail closed: when
exclude_tags is configured, drop DB-mode page results that have no identifiable name, similar to how markdown-mode snippets are already hidden when exclusions are active.
Whatever the fix, it should apply to both the text and JSON paths so they stay consistent.
Refs #56
While reviewing #56, a gap in the
exclude_tagsfiltering came up. In DB mode, both the text formatter and the new JSON formatter forsearchcompare page results against the excluded name set usingfullTitle or title or contentas the key. If a page result has neitherfullTitlenortitleand itscontentdoesn't hold the page name, the exclusion check silently fails open and the page is shown even though it should be filtered.In practice DB-mode search returns page entries with
contentequal to the page title, so the chance of this actually leaking a page is low. That's why I'm filing this as low priority rather than fixing it right away.Possible fixes when we get to it:
exclude_tagsis configured, drop DB-mode page results that have no identifiable name, similar to how markdown-mode snippets are already hidden when exclusions are active.Whatever the fix, it should apply to both the text and JSON paths so they stay consistent.
Refs #56