auditors may see the relevant part of the sphinx query

This commit is contained in:
SJ
2015-08-13 15:44:22 +02:00
parent 75b552e5e0
commit aa0d5e35c8
3 changed files with 19 additions and 0 deletions

View File

@ -72,6 +72,17 @@ class Sphinx {
if(ENABLE_SYSLOG == 1) { syslog(LOG_INFO, sprintf("sphinx query: '%s' in %.2f s, %d hits, %d total found", $query->query, $query->exec_time, $query->num_rows, $query->total_found)); }
$session = Registry::get('session');
$sphx_query = '';
$b = preg_split("/\ ORDER\ /", $query->query);
$a = preg_split("/\ WHERE\ /", $b[0]);
if(isset($a[1])) {
$sphx_query = preg_replace("/\'/", "\'", $a[1]);
}
$session->set("sphx_query", $sphx_query);
return $query;
}