bugphpGroupWare - Bugs: bug #12502, Error message when searching for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12502: Error message when searching for more than 1 word in the knowledge base form

Submitted by:  None
Submitted on:  Tue 29 Mar 2005 06:41:19 PM UTC  
 
Item Group: 0.9.16.005Category: knowledge base
Severity: 3 - NormalPriority: 7 - High
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: BZIP2Operating System: None
Reproducibility: Every TimePlanned Release: None
Fixed Release: 

Thu 31 Mar 2005 11:36:43 AM UTC, comment #1:

I will look at it. My app :)

Cheers

Dave Hall <skwashd>
Project Administrator
Tue 29 Mar 2005 06:41:19 PM UTC, original submission:

phpbrain/inc/class.sokb.inc.php has an error on line 342 when attempting to search for more than 1 word in the search field.

Correction is quite easy, the $cycle variable is not incremented after the first iteration of the loop.

Original :
Line 322 thru 336 :
foreach($search_words as $id => $word)
{
if($cycle)
{
$title .= "OR title LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$keywords .= "OR keywords LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$text .= "OR text LIKE '%" . $this->db->db_addslashes($word) . "%' ";
}
else
{
$title .= "(title LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$keywords .= "(keywords LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$text .= "(text LIKE '%" . $this->db->db_addslashes($word) . "%' ";
}
}

Correction, lines 322 thru 337 :

foreach($search_words as $id => $word)
{
if($cycle)
{
$title .= "OR title LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$keywords .= "OR keywords LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$text .= "OR text LIKE '%" . $this->db->db_addslashes($word) . "%' ";
}
else
{
$title .= "(title LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$keywords .= "(keywords LIKE '%" . $this->db->db_addslashes($word) . "%' ";
$text .= "(text LIKE '%" . $this->db->db_addslashes($word) . "%' ";
}
$cycle=1;
}

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by skwashd (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 06 Mar 2010 02:21:40 AM UTCskwashdAssigned toskwashd=>None
    Thu 31 Mar 2005 11:36:43 AM UTCskwashdAssigned toNone=>skwashd
    Wed 30 Mar 2005 07:26:48 PM UTCcafefroidCarbon-Copy-=>Added cafefroid

    Back to the top


    Powered by Savane 3.1-cleanup1