search query quote support

This commit is contained in:
SJ 2015-06-02 13:17:27 +02:00
parent 668630fb53
commit cdd78a5ad8
2 changed files with 21 additions and 1 deletions

View File

@ -47,6 +47,8 @@ $config['DEMO_MODE'] = 0;
$config['SHOW_MENU_FOR_OUTLOOK'] = 0;
$config['SEARCH_QUERY_QUOTING'] = 0;
$config['TIMEZONE'] = 'Europe/Budapest';
$config['PROVIDED_BY'] = 'www.mailpiler.org';
@ -164,7 +166,7 @@ $config['MAX_SEARCH_HITS'] = 1000;
$config['DEFAULT_RETENTION'] = 0;
$config['LOCALHOST'] = '127.0.0.1';
$config['PILER_HOST'] = '1.2.3.4';
$config['PILER_HOST'] = '127.0.0.1';
$config['PILER_PORT'] = 25;
$config['SMARTHOST'] = '127.0.0.1';
$config['SMARTHOST_PORT'] = 10026;

View File

@ -166,6 +166,24 @@ class ModelSearchSearch extends Model {
$i++;
}
if(SEARCH_QUERY_QUOTING == 1) {
$quoting = 0;
for($i=2; $i<count($data['match']); $i++) {
if(preg_match("/^\"/", $data['match'][$i])) {
$quoting = 1;
}
if($quoting == 0) {
$data['match'][$i] = '"' . $data['match'][$i] . '"';
}
if(preg_match("/\"$/", $data['match'][$i])) {
$quoting = 0;
}
}
}
$match = implode(" ", $data['match']);
if($emailfilter) {