Skip to content
Snippets Groups Projects
Commit 7faf3026 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge remote branch 'upstream-1.7/develop' into develop

Conflicts:
	include/mysqli.php
	include/staff/faq-categories.inc.php
	setup/tips.html
parents 49cda3d6 95e6c674
No related tags found
No related merge requests found
......@@ -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';
......
......@@ -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;
......
......@@ -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';
......
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment