/** * convert signature to text to remove all html tags and spaces/linebreaks, if the remains are empty -> set empty signature * * @param Expressomail_Model_Account $account */ protected function _checkSignature($account) { if (empty($account->signature)) { return; } $plainTextSignature = Expressomail_Message::convertFromHTMLToText($account->signature, "\n"); if (!preg_match('/[^\\s^\\n]/', $plainTextSignature, $matches) && !preg_match('/<img id="?user-signature-image-?[0-9]*"? alt="?([^\\"]+)"? src="data:image\\/jpeg;base64,([^"]+)">/i', $account->signature, $imgmatches)) { $account->signature = ''; } }