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

Submitter:  None
Submitted:  Tue 29 Mar 2005 06:41:19 PM UTC
   
 
Category:  knowledge base Item Group:  0.9.16.005
Severity:  3 - Normal Priority:  7 - High
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  BZIP2 Operating System:  None
Reproducibility:  Every Time Planned 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>
Group 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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-06 skwashd Assigned toskwashd None
    2005-03-31 skwashd Assigned toNone skwashd
    2005-03-30 cafefroid Carbon-Copy- Added cafefroid

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code