diff --git a/include/client/knowledgebase.inc.php b/include/client/knowledgebase.inc.php index 4d75bcba5be080eb463695fb8508d425ee11d608..1d00ca59ca9ca0b5e6e42724986b61ccef4090fc 100644 --- a/include/client/knowledgebase.inc.php +++ b/include/client/knowledgebase.inc.php @@ -72,7 +72,10 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search. if($_REQUEST['q']) { $sql.=" AND (question LIKE ('%".db_input($_REQUEST['q'],false)."%') OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%') - OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%'))"; + OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%') + OR cat.name LIKE ('%".db_input($_REQUEST['q'],false)."%') + OR cat.description LIKE ('%".db_input($_REQUEST['q'],false)."%') + )"; } $sql.=' GROUP BY faq.faq_id'; diff --git a/include/mysqli.php b/include/mysqli.php index 8b06a1742038547ca38b816485bed1e48f707193..06d4032fdc5419f3ffd24bd5a0fe6abe2ea46fb4 100644 --- a/include/mysqli.php +++ b/include/mysqli.php @@ -38,9 +38,7 @@ function db_connect($host, $user, $passwd, $options = array()) { elseif(!$passwd) return NULL; - //Connectr - $start = microtime(true); - $port = 3306; + $port = ini_get("mysqli.default_port"); if (strpos($host, ':') !== false) { list($host, $port) = explode(':', $host); // PHP may not honor the port number if connecting to 'localhost' @@ -49,6 +47,9 @@ function db_connect($host, $user, $passwd, $options = array()) { $host = gethostbyname($host); $port = (int) $port; } + + // Connect + $start = microtime(true); if (!@$__db->real_connect($host, $user, $passwd, null, $port)) # nolint return NULL; diff --git a/include/staff/faq-categories.inc.php b/include/staff/faq-categories.inc.php index da41c80f2a3bf08f51add08bbc67d84b7deeaf1b..f39ad10c026a2f70d8b60700ed1abd09c2c753ca 100644 --- a/include/staff/faq-categories.inc.php +++ b/include/staff/faq-categories.inc.php @@ -56,6 +56,7 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied'); if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search. $sql='SELECT faq.faq_id, question, ispublished, count(attach.file_id) as attachments, count(ft.topic_id) as topics ' .' FROM '.FAQ_TABLE.' faq ' + .' LEFT JOIN '.FAQ_CATEGORY.' cat ON(cat.category_id=faq.category_id) ' .' LEFT JOIN '.FAQ_TOPIC_TABLE.' ft ON(ft.faq_id=faq.faq_id) ' .' LEFT JOIN '.ATTACHMENT_TABLE.' attach ON(attach.object_id=faq.faq_id AND attach.type=\'F\' AND attach.inline = 0) ' @@ -68,9 +69,12 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search. $sql.=' AND ft.topic_id='.db_input($_REQUEST['topicId']); if($_REQUEST['q']) { - $sql.=" AND question LIKE ('%".db_input($_REQUEST['q'],false)."%') + $sql.=" AND (question LIKE ('%".db_input($_REQUEST['q'],false)."%') OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%') - OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%') "; + OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%') + OR cat.name LIKE ('%".db_input($_REQUEST['q'],false)."%') + OR cat.description LIKE ('%".db_input($_REQUEST['q'],false)."%') + )"; } $sql.=' GROUP BY faq.faq_id'; diff --git a/setup/tips.html b/setup/tips.html index f1089688592465c36e96aad2d27e5c21fcf82da6..daf02e96a7ce380bbac118399222127f3d54727e 100644 --- a/setup/tips.html +++ b/setup/tips.html @@ -50,7 +50,7 @@ specified as <code>hostname:port</code> <p>Name of the database osTicket will use.</p> </div> <div id="t12"> -<b>MySQL Username</b> +<b>MySQL Username</b> <p>The MySQL user must have full rights to the database.</p> </div> <div id="t13">