Page 1 of 1

multi words kb search return blank page

Posted: Thu Feb 28, 2013 11:19 am
by deserteagle369
Script URL:
Version of script: 2.41
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
I added multi words(seperate by space) search feature in my installation.
knowledgebase.php

Code: Select all

function hesk_kb_search($query) {
	global $hesk_settings, $hesklang;

    define('HESK_NO_ROBOTS',1);

	/* Print header */
    $hesk_settings['tmp_title'] = $hesklang['sr'] . ': ' . substr(hesk_htmlspecialchars(stripslashes($query)),0,20);
	require_once(HESK_PATH . 'inc/header.inc.php');
	hesk_kb_header($hesk_settings['kb_link']);

	$arr=preg_split('/[\s,]+/',$query); // zhang:seperate with space or comma
	for ($i=0;$i<count($arr);$i++) $arr[$i]='CONCAT(subject,content) LIKE "%'.$arr[$i].'%"'; //zhang:create conditions
	$cond=join(' AND ', $arr);
	$sql = 'SELECT t1.* FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'kb_articles` AS t1 LEFT JOIN `'.hesk_dbEscape($hesk_settings['db_pfix']).'kb_categories` AS t2 ON t1.`catid` = t2.`id` WHERE t1.`type`=\'0\' AND t2.`type`=\'0\' AND ('.$cond.') ORDER BY subject DESC LIMIT 99';
if type more than 3 english words then press Enter, it work well, but if type more than 3 Chinese words,it show a blank page with the url like this:
any idea?

Re: multi words kb search return blank page

Posted: Fri Mar 01, 2013 2:49 pm
by Klemen
Do you get any errors if you enable Debug mode in HESK settings?

And check your server logs, it could be something on the server blocking the request (mod_security?).