2.0.2, Search.php - Subject_highlighted - Using <strong> may break code

Started by Aleksi "Lex" Kilpinen, March 12, 2012, 04:37:04 AM

Previous topic - Next topic

Aleksi "Lex" Kilpinen

Example attached as image.

The searched string was "Tee työtä jolla on tarkoitus" and the found Topic title was an exact match.

Changing this


$subject_highlighted = preg_replace('/(' . preg_quote($query, '/') . ')/i' . ($context['utf8'] ? 'u' : ''), '<strong class="highlight">$1</strong>', $subject_highlighted);


To this
$subject_highlighted = preg_replace('/(' . preg_quote($query, '/') . ')/i' . ($context['utf8'] ? 'u' : ''), '<b class="highlight">$1</b>', $subject_highlighted);

In search.php fixed it for me.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

emanuele

There is a funny report by Spuds about that somewhere regarding a class. :P
I think Spuds changed a lot the search in the development branch. I'm wondering do you have the possibility to do some test with your database to see if it's still an issue? (I'm not suggesting you to use it "in production", just if you have a backup you could setup a test forum... O:))


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Aleksi "Lex" Kilpinen

Don't have one handy at the moment, and even if I did - It would be quite huge just for testing purposes. :D
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Aleksi "Lex" Kilpinen

Can't blame you for that :P
I might see if I couldn get a test forum running with the dev branch again at some point, but until then...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor

Hmm, interesting.

http://www.simplemachines.org/community/index.php?topic=413837.0 is a duplicate report, closing that, going to investigate this, but the use of b to fix the problem is surely not the proper fix.

Kays

Why not just move it into the css. From what I can see, class="highlight" is only used in three places and in each it is used in conjunction with <strong>.

So is <strong> really needed there? ???

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Arantor

That's the point, sure - but if something is munging a <strong> tag, how do I know it won't munge something like a <span> tag?


Advertisement: