Skip to content

Commit

Permalink
Move AND/OR charset conversion
Browse files Browse the repository at this point in the history
We need to honor the $convert parameter.
  • Loading branch information
slusarz committed May 8, 2015
1 parent 6724968 commit 2c80c52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions framework/Imap_Client/lib/Horde/Imap/Client/Search/Query.php
Expand Up @@ -83,6 +83,10 @@ public function charset($charset, $convert = true)
$oldcharset = $this->_charset;
$this->_charset = Horde_String::upper($charset);

if (!$convert || ($oldcharset == $this->_charset)) {
return;
}

foreach (array('and', 'or') as $item) {
if (isset($this->_search[$item])) {
foreach ($this->_search[$item] as &$val) {
Expand All @@ -91,10 +95,6 @@ public function charset($charset, $convert = true)
}
}

if (!$convert || ($oldcharset == $this->_charset)) {
return;
}

foreach (array('header', 'text') as $item) {
if (isset($this->_search[$item])) {
foreach ($this->_search[$item] as $key => $val) {
Expand Down

0 comments on commit 2c80c52

Please sign in to comment.