Search returns borked topic title, split <strong> tags, only on this topic. Can't find it. >:(
Thanks for all the suggestions. :P Having studied this further, am able to replicate the glitch on test install. The original topic is here (https://ebook-mecca.com/index.php?topic=1424.0), if you search the title 'The Mill on the Floss' from home page, you'll see the result 'The ong class="highlight">Millong> on the Floss'. The problem is the title, if it's in a child board and contains 'll on', search result is scrambled. Any title string that includes 'l on ' (i.e., testl on test) will search badly. This appears to be a very obscure bug in the search function.
It's in Search.php -
/// search glitch original
// $subject_highlighted = preg_replace('/(' . preg_quote($query, '/') . ')/i' . ($context['utf8'] ? 'u' : ''), '<strong class="highlight">$1</strong>', $subject_highlighted);
/// search glitch fix
$subject_highlighted = preg_replace('/(' . preg_quote($query, '/') . ')/i' . ($context['utf8'] ? 'u' : ''), '<span class="highlight">$1</span>', $subject_highlighted);
The <strong> tags are redundant, .highlight class includes bold -
/* Highlighted text - such as search results. */
.highlight
{
font-weight: bold;
color: #ff7200 !important;
font-size: 1.1em;
}
Don't know why it breaks the string, but corrected code seems to fix it.
A similar bug has come up before which triggered the highlighting algorithm to be redone in 2.1.
Is 2.0 still getting bug fixes?
Quote from: Sir Osis of Liver on November 24, 2021, 10:25:05 PMIs 2.0 still getting bug fixes?
Currently, we are actually aiming to fix some of the more visible bugs in .18 with our next patch, but on a general level 2.1 takes priority.