Skip to content

Commit

Permalink
[mms] Added the 'noquote' option to Horde_Mail_Rfc822_Object#writeAdd…
Browse files Browse the repository at this point in the history
…ress().
  • Loading branch information
slusarz committed Jul 28, 2014
1 parent ab5018e commit f414b7e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
10 changes: 10 additions & 0 deletions framework/Mail/doc/Horde/Mail/UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
This lists the API changes between releases of the package.


Upgrading to 2.4
================

- Horde_Mail_Rfc822_Object

- writeAddress()

Added the 'noquote' option.


Upgrading to 2.3
================

Expand Down
4 changes: 3 additions & 1 deletion framework/Mail/lib/Horde/Mail/Rfc822/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ protected function _writeAddress($opts)
if (!empty($opts['encode'])) {
$personal = Horde_Mime::encode($this->personal, $opts['encode']);
}
$personal = $rfc822->encode($personal, 'personal');
if (empty($opts['noquote'])) {
$personal = $rfc822->encode($personal, 'personal');
}
}

return (strlen($personal) && ($personal != $address))
Expand Down
6 changes: 4 additions & 2 deletions framework/Mail/lib/Horde/Mail/Rfc822/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ protected function _writeAddress($opts)
if (!empty($opts['encode'])) {
$groupname = Horde_Mime::encode($groupname, $opts['encode']);
}
if (empty($opts['noquote'])) {
$groupname = $rfc822->encode($groupname, 'personal');
}

$rfc822 = new Horde_Mail_Rfc822();

return $rfc822->encode($groupname, 'personal') . ':' .
(strlen($addr) ? (' ' . $addr) : '') . ';';
return $groupname . ':' . (strlen($addr) ? (' ' . $addr) : '') . ';';
}

/**
Expand Down
3 changes: 3 additions & 0 deletions framework/Mail/lib/Horde/Mail/Rfc822/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function __toString()
* (Punycode/RFC 3490).
* Requires the idn or intl PHP module.
* DEFAULT: false
* - noquote: (boolean) If true, don't quote personal part. [@since
* 2.4.0]
* DEFAULT: false
*
* @return string The correctly escaped/quoted address.
*/
Expand Down
12 changes: 6 additions & 6 deletions framework/Mail/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
</lead>
<date>2014-05-21</date>
<version>
<release>2.3.1</release>
<api>2.3.0</api>
<release>2.4.0</release>
<api>2.4.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [mms] Added the &apos;noquote&apos; option to Horde_Mail_Rfc822_Object#writeAddress().
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -602,15 +602,15 @@
</release>
<release>
<version>
<release>2.3.1</release>
<api>2.3.0</api></version>
<release>2.4.0</release>
<api>2.4.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2014-05-21</date>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [mms] Added the &apos;noquote&apos; option to Horde_Mail_Rfc822_Object#writeAddress().
</notes>
</release>
</changelog>
Expand Down

0 comments on commit f414b7e

Please sign in to comment.