summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-01-01 10:54:57 +0100
committerAleksander Machniak <alec@alec.pl>2013-01-01 10:54:57 +0100
commit347ba311e68f3a641805a268313fcd5ed851feb7 (patch)
tree04a989b06aa6778ca5a75a40739b038d268588f9 /program
parent5438956debdf254ed1b49ef144f1626007b9e669 (diff)
Add possibility to search in message body only (#1488770)
Diffstat (limited to 'program')
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/steps/mail/search.inc7
2 files changed, 5 insertions, 3 deletions
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index d2a46ecc6..9deaa6677 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -200,6 +200,7 @@ $labels['quicksearch'] = 'Quick search';
$labels['resetsearch'] = 'Reset search';
$labels['searchmod'] = 'Search modifiers';
$labels['msgtext'] = 'Entire message';
+$labels['body'] = 'Body';
$labels['openinextwin'] = 'Open in new window';
$labels['emlsave'] = 'Download (.eml)';
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index f9b8f9e67..fb1b48797 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -69,7 +69,7 @@ else if (preg_match("/^subject:.*/i", $str))
else if (preg_match("/^body:.*/i", $str))
{
list(,$srch) = explode(":", $str);
- $subject['text'] = "TEXT";
+ $subject['body'] = "BODY";
}
else if (strlen(trim($str)))
{
@@ -81,7 +81,7 @@ else if (strlen(trim($str)))
break;
}
else {
- $subject[$header] = 'HEADER '.strtoupper($header);
+ $subject[$header] = ($header != 'body' ? 'HEADER ' : '') . strtoupper($header);
}
}
@@ -89,7 +89,8 @@ else if (strlen(trim($str)))
$search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT);
$search_mods[$mbox] = array_fill_keys(array_keys($subject), 1);
$RCMAIL->user->save_prefs(array('search_mods' => $search_mods));
- } else {
+ }
+ else {
// search in subject by default
$subject['subject'] = 'HEADER SUBJECT';
}