Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14659

Search terms don't highlight when showing search results by topic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.2.0-b2
    • Search
    • None

      When you perform a search in phpBB, the search terms are normally highlighted in the results. This only seems to work for posts, however; if you change the view to show topics instead of posts, nothing is highlighted (i.e. no text is wrapped inside <span class="posthilit"> or a similar HTML element). I've verified this both on my local install of 3.2.0-b2 and the try-phpbb.com install of 3.1.x just to make sure it wasn't my local environment or installed extensions.

      Normally I would assume phpBB just doesn't offer highlighting in the topic view for search results, but it looks like phpBB does generate an HTML string with highlighted text in the topic title in search.php:992, where a preg_replace changes all mentions of the search keywords into text wrapped by <span class="posthilit"> just like for posts. The only problem is this never gets output to the template or used anywhere as far as I can tell.

      Not sure what the expected behavior is supposed to be here, but for our purposes it would be nice if phpBB kept the highlighting option on topics as well.

            Unassigned Unassigned
            rfdy rfdy [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: