search bug in phpmyfaq 1.5.0-1.5.1

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
nexus3497
Posts: 3
Joined: Tue Sep 20, 2005 12:19 am
Contact:

search bug in phpmyfaq 1.5.0-1.5.1

Post by nexus3497 »

Hello,

I just noticed a small bug in the searching feature. If I do a search for just one letter (even though that should not be allowed), the search is done anyway, and if I click on one of the results, in some of them there are some html tags shown in the output (this is true on both firefox and ie, I don't know about other browsers). Here is an example:

http://faq.wondernet.nu/index.php?actio ... ighlight=b

It seems the articles all show correctly, unless they are found by doing a search for just one letter. Is there a way I can patch this?
nexus3497
Posts: 3
Joined: Tue Sep 20, 2005 12:19 am
Contact:

Post by nexus3497 »

if it helps, I am using mod_rewrite on the board with mysql:


phpMyFAQ Version
phpMyFAQ 1.5.1
Server Software
Apache/2.0.52 (Unix) PHP/5.0.4
PHP Version
PHP 5.0.4
PHP Memory Limit
8M
Register Globals
off
Safe Mode
off
Database Client Version
4.1.7
Database Server Version
4.1.7-standard
Webserver Interface
APACHE2HANDLER
nexus3497
Posts: 3
Joined: Tue Sep 20, 2005 12:19 am
Contact:

Post by nexus3497 »

as a temporary workaround, I changed line 56 of artikel.php from this:

Code: Select all

if (isset($_GET["highlight"]) && $_GET["highlight"] != "/" && $_GET["highlight"] != "<" && $_GET["highlight"] != ">") {
to this:

Code: Select all

if (isset($_GET["highlight"]) && $_GET["highlight"] != "/" && $_GET["highlight"] != "<" && $_GET["highlight"] != ">" && strlen($_GET["highlight"]) > 1) {
and that just turns off highlighting when you enter into a thread from the search results page, if the search was just one character long.
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you're right, this is a stupid bug. :-(

I'll add your patch into CVS. Thanks a lot!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply