Skip to content

Commit

Permalink
Exceptions cannot be thrown in __toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Mar 5, 2014
1 parent bedf7d5 commit b0c0d1e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/Imap_Client/lib/Horde/Imap/Client/Search/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ class Horde_Imap_Client_Search_Query implements Serializable
*/
public function __toString()
{
$res = $this->build(null);
return $res['query']->escape();
try {
$res = $this->build(null);
return $res['query']->escape();
} catch (Exception $e) {
return '';
}
}

/**
Expand Down

0 comments on commit b0c0d1e

Please sign in to comment.