1)my site and my sql database are in utf-8 so in order for content to be inserted right in the database and be searchable
i added set names utf8. Otherwise the content inserts in the database like weird characters...
Line 109 include.php
Code: Select all
#Load them into the usual variables. This'll go away a little later on.
global $DONT_LOAD_DB;
if (!isset($DONT_LOAD_DB))
{
$cmsdb =& $gCms->GetDB();
$cmsdb->Execute('set names utf8'); // database connection with utf-8
}
Line 21 action.dosearch.php
Code: Select all
#$searchphrase = implode(' OR ', array_fill(0, $nb_words, 'word = ?'));
$ary = array();
foreach ($words as $word)
{
$word = trim($word);
$ary[] = "word = " . $db->qstr($word, ENT_COMPAT, 'UTF-8'); //query results in utf-8
}
$searchphrase = implode(' OR ', $ary);
}
Code: Select all
mode : "exact"
4)I don't know if this is a bug but when you put a searchword in the search box that has preceding spaces, some weird character results appear in the result page! The above change in code (trim) fixed it but i don't know what is causing it.
Line 6 action.dosearch.php
Code: Select all
// Fix to prevent XSS like behaviour. See: http://www.securityfocus.com/archive/1/455417/30/0/threaded
$params['searchinput'] = htmlspecialchars(trim($params['searchinput'])); //trim added
@$this->SendEvent('SearchInitiated', array(&$params['searchinput']));
And if yes can they be implemented in the next release?
Thank you very much.